NeptuneC API Manual - ENG
NeptuneC API Manual - ENG
1. License............................................................................................................................................. 1
1.1 Note ....................................................................................................................................... 1
2. NeptuneC API .................................................................................................................................. 2
2.1 About the API ....................................................................................................................... 2
2.2 System Requirement ............................................................................................................ 2
2.3 Software Requirement ......................................................................................................... 2
3. Summary of API functions .............................................................................................................. 3
4. API function details ........................................................................................................................ 7
4.1 Library Initialization ............................................................................................................. 7
4.1.1 ntcInit ......................................................................................................................... 8
4.1.2 ntcUninit ..................................................................................................................... 9
4.2 Camera Information ........................................................................................................... 10
4.2.1 ntcGetCameraCount ................................................................................................. 11
4.2.2 ntcGetCameraInfo .................................................................................................... 12
4.2.3 ntcSetDeviceCheckCallback ..................................................................................... 14
4.3 Camera control ................................................................................................................... 15
4.3.1 ntcOpen .................................................................................................................... 16
4.3.2 ntcClose .................................................................................................................... 18
4.3.3 ntcGetCameraType ................................................................................................... 19
4.3.4 ntcSetHeartbeatTime ............................................................................................... 21
4.3.5 ntcSetUnplugCallback .............................................................................................. 22
4.3.6 ntcShowControlDialog ............................................................................................. 23
4.3.7 ntcSetPacketResend................................................................................................. 24
4.4 Image information and setting .......................................................................................... 25
4.4.1 ntcGetPixelFormatList .............................................................................................. 26
4.4.2 ntcGetPixelFormat.................................................................................................... 28
4.4.3 ntcGetPixelFormatString.......................................................................................... 29
4.4.4 ntcSetPixelFormat .................................................................................................... 30
4.4.5 ntcGetBitsPerPixel.................................................................................................... 31
4.4.6 ntcGetFrameRateList ............................................................................................... 32
4.4.7 ntcGetFrameRate ..................................................................................................... 34
4.4.8 ntcGetFrameRateString ........................................................................................... 35
4.4.9 ntcSetFrameRate ...................................................................................................... 36
4.4.10 ntcGetImageSize ...................................................................................................... 37
4.4.11 ntcGetMaxImageSize ............................................................................................... 38
4.4.12 ntcSetImageSize ...................................................................................................... 39
4.4.13 ntcGetBayerConvert ................................................................................................. 40
4.4.14 ntcSetBayerConvert ................................................................................................. 41
4.4.15 ntcGetBayerLayout ................................................................................................... 42
4.4.16 ntcSetBayerLayout ................................................................................................... 43
4.4.17 ntcGetBytePerPacket ............................................................................................... 44
4.4.18 ntcSetBytePerPacket ................................................................................................ 45
4.4.19 ntcGetPacketSize...................................................................................................... 46
4.4.20 ntcSetPacketSize ...................................................................................................... 47
4.5 Acquire image ..................................................................................................................... 48
4.5.1 ntcGetAcquisitionMode ............................................................................................ 49
4.5.2 ntcSetAquisitionMode .............................................................................................. 50
4.5.3 ntcOneShot ............................................................................................................... 51
4.5.4 ntcMultiShot ............................................................................................................. 52
4.5.5 ntcSetBufferCount .................................................................................................... 53
4.5.6 ntcGetBufferSize ...................................................................................................... 54
4.5.7 ntcSetUserBuffer ...................................................................................................... 55
4.5.8 ntcSetEffect .............................................................................................................. 56
4.5.9 ntcGrab ..................................................................................................................... 57
4.5.10 ntcSetFrameCallback................................................................................................ 59
4.5.11 ntcSetFrameDropCallback........................................................................................ 61
4.5.12 ntcSetDisplay ............................................................................................................ 62
4.5.13 ntcSetAcquisition ..................................................................................................... 63
4.5.14 ntcGetAcquisition ..................................................................................................... 64
4.5.15 ntcSetMulticastAddress............................................................................................ 65
4.5.16 ntcGetReceiveFrameRate......................................................................................... 66
4.5.17 ntcGetRGBData......................................................................................................... 67
4.5.18 ntcSaveImage........................................................................................................... 68
4.5.19 ntcStartStreamCapture ............................................................................................ 69
4.5.20 ntcStopStreamCapture ............................................................................................. 70
4.5.21 ntcSetRecvDroppedFrame ....................................................................................... 71
4.5.22 ntcSetRotation.......................................................................................................... 72
4.6 Feature Control ................................................................................................................... 73
4.6.1 ntcGetFeature ........................................................................................................... 75
4.6.2 ntcSetFeature ........................................................................................................... 77
4.6.3 ntcSetShutterString ................................................................................................. 78
4.6.4 ntcGetAutoAreaControl ............................................................................................ 79
4.6.5 ntcSetAutoAreaControl ............................................................................................ 81
4.6.6 ntcSetAFControl ....................................................................................................... 83
4.6.7 ntcSaveCameraParameter ....................................................................................... 84
4.6.8 ntcLoadCameraParameter ....................................................................................... 86
4.6.9 ntcSetNTSCPALSelector ........................................................................................... 87
4.6.10 ntcGetNTSCPALSelector ........................................................................................... 88
4.6.11 ntcSetAcquisitionFrameRateSel ............................................................................... 89
4.6.12 ntcGetAcquisitionFrameRateSel .............................................................................. 90
4.6.13 ntcGetAcquisitionFrameRateList ............................................................................. 91
4.6.14 ntcSetResolutionSelector ......................................................................................... 92
4.6.15 ntcGetResolutionSelector ........................................................................................ 93
4.6.16 ntcGetResolutionList ................................................................................................ 94
4.6.17 ntcSetDayNightModeSelector .................................................................................. 95
4.6.18 ntcGetDayNightModeSelector .................................................................................. 96
4.7 Trigger information and setting ......................................................................................... 97
4.7.1 ntcGetTriggerInfo..................................................................................................... 99
4.7.2 ntcGetTrigger .......................................................................................................... 101
4.7.3 ntcSetTrigger ........................................................................................................... 102
4.7.4 ntcGetTriggerDelay ................................................................................................. 103
4.7.5 ntcSetTriggerDelay.................................................................................................. 104
4.7.6 ntcRunSWTrigger .................................................................................................... 105
4.7.7 ntcReadTriggerTable ............................................................................................... 106
4.7.8 ntcSaveTriggerTable ............................................................................................... 108
4.7.9 ntcLoadTriggerTable ............................................................................................... 109
4.7.10 ntcSetTriggerMode14Exposure............................................................................... 110
4.7.11 ntcSetUSBTriggerBufferCount ................................................................................ 111
4.8 Strobe information and setting ......................................................................................... 112
4.8.1 ntcGetStrobeInfo..................................................................................................... 113
4.8.2 ntcGetStrobe ........................................................................................................... 115
4.8.3 ntcSetStrobe ............................................................................................................ 116
4.9 Auto iris control ................................................................................................................. 117
4.9.1 ntcSetAutoIrisMode ................................................................................................ 118
4.9.2 ntcGetAutoIrisAverageFrame ................................................................................. 119
4.9.3 ntcSetAutoIrisAverageFrame .................................................................................. 120
4.9.4 ntcGetAutoIrisTargetValue ..................................................................................... 121
4.9.5 ntcSetAutoIrisTargetValue ..................................................................................... 122
4.10 GPIO control ...................................................................................................................... 123
4.10.1 ntcSetGPIO .............................................................................................................. 124
4.11 UserSet control .................................................................................................................. 125
4.11.1 ntcGetUserSet ......................................................................................................... 126
4.11.2 ntcSetUserSet .......................................................................................................... 127
4.11.3 ntcSetDefaultUserSet .............................................................................................. 128
4.11.4 ntcSetPowerOnDefaultUserSet ............................................................................... 129
4.12 Look-up-table control ........................................................................................................ 130
4.12.1 ntcGetKneeLUT ........................................................................................................ 131
4.12.2 ntcSetKneeLUT ........................................................................................................ 132
4.12.3 ntcGetUserLUT......................................................................................................... 133
4.12.4 ntcSetUserLUT ......................................................................................................... 134
4.13 Frame Save control ............................................................................................................ 135
4.13.1 ntcGetFrameSave .................................................................................................... 136
4.13.2 ntcSetFrameSave..................................................................................................... 137
4.14 SIO control ......................................................................................................................... 138
4.14.1 ntcSetSIO................................................................................................................. 139
4.14.2 ntcWriteSIO ............................................................................................................. 141
4.14.3 ntcReadSIO.............................................................................................................. 142
4.15 Register access .................................................................................................................. 143
4.15.1 ntcReadRegister ...................................................................................................... 144
4.15.2 ntcWriteRegister ..................................................................................................... 145
4.15.3 ntcReadBlock ........................................................................................................... 146
4.15.4 ntcWriteBlock .......................................................................................................... 147
4.15.5 ntcWriteBroadcast................................................................................................... 148
4.16 XML control ........................................................................................................................ 149
4.16.1 ntcGetNodeVisibility ................................................................................................ 150
4.16.2 ntcSetNodeVisibility ................................................................................................ 151
4.16.3 ntcGetNodeList ........................................................................................................ 152
4.16.4 ntcGetNodeInfo ....................................................................................................... 153
4.16.5 ntcGetNodeInt ......................................................................................................... 155
4.16.6 ntcSetNodeInt ......................................................................................................... 157
4.16.7 ntcGetNodeFloat...................................................................................................... 158
4.16.8 ntcSetNodeFloat ...................................................................................................... 160
4.16.9 ntcGetNodeEnum .................................................................................................... 161
4.16.10 ntcSetNodeEnum ..................................................................................................... 163
4.16.11 ntcGetNodeString .................................................................................................... 164
4.16.12 ntcSetNodeString .................................................................................................... 165
4.16.13 ntcGetNodeBoolean................................................................................................. 166
4.16.14 ntcSetNodeBoolean ................................................................................................. 167
4.16.15 ntcSetNodeCommand .............................................................................................. 168
5. Revision History .......................................................................................................................... 169
5.1 Changes from previous version (1.0.0.0) ......................................................................... 169
5.2 Changes from previous version (1.0.1.0) ......................................................................... 169
5.3 Changes from previous version (1.0.2.0) ......................................................................... 169
5.4 Changes from previous version (2.0.0.0) ......................................................................... 169
5.5 Changes from previous version (2.0.1.0) ......................................................................... 169
NeptuneC API Manual – V5.0.0.0 Page 1
1. License
1.1 Note
IMI TECHNOLOGY GigE Vision™/USB3 Vision™/IEEE 1394 Camera API (NeptuneC C type library) only supports IMI
TECHNOLOGY hardware and strictly forbidden to use or build application for cameras or hardware from other
vendors with this API.
By Installing, copying or otherwise using the SOFTWARE, you agree to be bound by the terms of the End User
License Agreements (EULA). The SOFTWARE includes IMI TECHNOLOGY and IMI TECHNOLOGY suppliers’
intellectual property. Please read IMI TECHNOLOGY and IMI TECHNOLOGY supplier’s EULA before installing the
SOFTWARE. If you do not accept the terms of the license agreements, please do not install copy or use this
SOFTWARE.
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 2
2. NeptuneC API
2.1 About the API
The NeptuneC API is implemented as C-type function library and it is based on the GenICamTM
(www.genicam.org) which provides a generic programming interface for Gigabit Ethernet Cameras and IEEE
1394 Cameras that are compliant to the GigE Vision™, USB3 Vision™ and IEEE 1394 Standard Specification.
Please refer to the IEEE homepage (www.ieee.org), GigE vision homepage (www.machinevisiononline.org) and
AIA homepage(www.visiononline.org) for further details about the standard specification for both types of
cameras.
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 3
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 4
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 5
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 6
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 7
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 8
4.1.1 ntcInit
Description
Initialize the NeptuneC library.
Definition
ENeptuneError ntcInit()
Parameters
None
Remark
This API function should be called first before calling any other API functions.
Example
ref. NeptuneC Library\Samples\C++\0.SingleAcquisition
ntcInit();
See Also
ntcUnit
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 9
4.1.2 ntcUninit
Description
Unitialize and clear the NeptuneC library.
Definition
ENeptuneError ntcUninit()
Parameters
None
Remark
User should clear the NeptuneC API by calling this function before closing his own application.
Example
ref. NeptuneC Library\Samples\C++\0.SingleAcquisition
ntcUninit();
See Also
ntcInit
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 10
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 11
4.2.1 ntcGetCameraCount
Description
Get the number of cameras connected to the system.
Definition
ENeptuneError ntcGetCameraCount(_uint32_t* pnNumbers)
Parameters
[OUT] pnNumbers : number of cameras
Remark
User can get all connected cameras including 1394, GigE and USB3 camera with this function.
Example
ref. NeptuneC Library\Samples\C++\0.SingleAcquisition
_uint32_ t nCount;
if ( ntcGetCameraCount(&nCount) == NEPTUNE_ERR_Success)
; // do something
See Also
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 12
4.2.2 ntcGetCameraInfo
Description
Get information of all cameras.
Definition
ENeptuneError ntcGetCameraInfo(PNEPTUNE_CAM_INFO pInfo, _uint32_t nLegnth)
Parameters
[OUT] pInfo : pointer of NEPTUNE_CAM_INFO structure
[IN] nLength : size of the NEPTUNE_CAM_INFO structure
Remark
User can get camera information with this function. User should call this function after allocating the
“NPETUNE_CAM_INFO” structure as much as returned by the “ntcGetCameraCount” function. The
NEPTUNE_CAM_INFO is defined in the “NeptuneDev.h” as below.
struct NEPTUNE_CAM_INFO {
_char_t strVendor[MAX_STRING_LENGTH]; // camera vendor name
_char_t strModel[MAX_STRING_LENGTH]; // camera model name
_char_t strSerial[MAX_STRING_LENGTH]; // camera serial number
_char_t strUserID[MAX_STRING_LENGTH]; // user ID
_char_t strIP[MAX_STRING_LENGTH]; // IP address(GigE camera)
_char_t strMAC[MAC_LENGTH]; // MAC address(GigE camera)
_char_t strSubnet[MAX_STRING_LENGTH]; // Subnet address(GigE camera)
_char_t strGateway[MAX_STRING_LENGTH]; // Gateway address(GigE camera)
_char_t strCamID[MAX_STRING_LENGTH]; // unique Camera ID
};
typedef NEPTUNE_CAM_INFO* PNEPTUNE_CAM_INFO;
The camera other than GigE has no information about “strip”, “strMAC”, “strSubnet”, “strGateway”. And
these information is blank.
Example
ref. NeptuneC Library\Samples\C++\0.SingleAcquisition
PNEPTUNE_CAM_INFO pCamInfo = NULL;
_uint32_t nCameras = 0;
if ( ntcGetCameraCount(&nCameras) == NEPTUNE_ERR_Success )
{
pCamInfo = new NEPTUNE_CAM_INFO[nCameras];
ntcGetCameraInfo(pCamInfo, nCameras);
}
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 13
See Also
ntcGetCameraCount
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 14
4.2.3 ntcSetDeviceCheckCallback
Description
Register callback function which is called when camera number has changed.
Definition
ENeptuneError ntcSetDeviceCheckCallback(NeptuneCDevCheckCallback DeviceCallback,
void* pContext)
Parameters
[IN] DeviceCallback : callback function
[IN] pContext : user parameter passed to the callback function
Remark
This API function is used to register callback function which is called when number of camera
connected to the system is changed. If camera count is increased, the “NEPTUNE_DEVICE_ADDED”
state is passed to the callback function and if decreased, “NEPTUNE_DEVICE_REMOVED” is passed.
The callback function is defined in the “NeptuneDef.h” as below.
enum ENeptuneDeviceChangeState
{
NEPTUNE_DEVICE_ADDED = 0, // camera count is increased
NEPTUNE_DEVICE_REMOVED =1 // camera count is decreased
};
Example
ref. NeptuneC Library\Samples\C++\GUI\0.App
void DeviceCheckCallback(ENeptuneDeviceChangeState eState, void* pContext)
{
}
ntcSetDeviceCheckCallback(DeviceCheckCallback, this);
See Also
ntcSetUnplugCallback
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 15
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 16
4.3.1 ntcOpen
Description
Get the camera handle to access.
Definition
NeptuneCamHandle ntcOpen(_char_t* pstrDevID, NeptuneCamHandle* phCamHandle,
ENeptuneDevAccess eAccessFlag=NEPTUNE_DEV_ACCESS_EXCLUSIVE)
Parameters
[IN] pstrDevID : ID string of a camera
[OUT] phCamHandle : camera handle
[IN, Optional] AccessFlag : control mode
Remark
User should get the information of a camera to get the access right and use the “strCamID” element of
the “NEPTUNE_CAM_INFO” structure to get the access right. The “ENeptuneDevAccess” enumeration
declared in the “NeptuneDev.h” is used to get the access right and it is defined as below. The
“NEPTUNE_DEV_ACCESS_CONTROL” and “NEPTUNE_DEV_ACCESS_MONITOR” value is used for the
multicast stream mode.
The return handle of this function is used for other API functions.
Example
ref. NeptuneC Library\Samples\C++\0.SingleAcquisition
PNEPTUNE_CAM_INFO pCamInfo = NULL;
_uint32_t nCameras = ntcGetCameraCount();
if ( nCameras > 0 )
{
pCamInfo = new NEPTUNE_CAM_INFO[nCameras];
ntcGetCameraInfo(pCamInfo, nCameras);
}
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 17
NeptuneCamHandle hCamHandle;
// if unicast
ntcOpen(pCamInfo[0].strCamID, &hCamHandle);
// if multicast
ntcOpen(pCamInfo[0].strCamID, &hCamHandle, NEPTUNE_DEV_ACCESS_CONTROL);
See Also
ntcClose
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 18
4.3.2 ntcClose
Description
Close the camera handle.
Definition
ENeptuneError ntcClose(NeptuneCamHandle hCamHandle)
Parameters
[IN] hCamHandle : camera handle
Remark
Call this function if camera is not used any more.
Example
ref. NeptuneC Library\Samples\C++\0.SingleAcquisition
PNEPTUNE_CAM_INFO pCamInfo = NULL;
_uint32_t nCameras = 0;
if ( ntcGetCameraCount(&nCameras) == NEPTUNE_ERR_Success )
{
pCamInfo = new NEPTUNE_CAM_INFO[nCameras];
ntcGetCameraInfo(pCamInfo, nCameras);
}
NeptuneCamHandle hCamHandle;
if ( ntcOpen(pCamInfo[0].strCamID, &hCamHandle) == NEPTUNE_ERR_Success )
{
ntcClose(hCamHandle);
hCamHandle = NULL;
}
See Also
ntcOpen
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 19
4.3.3 ntcGetCameraType
Description
Get the type of a camera.
Definition
ENeptuneError ntcGetCameraType(NeptuneCamHandle hCamHandle,
ENeptuneDevType* peType)
Parameters
[IN] hCamHandle : camera handle
[OUT] peType : camera type (1394 or GigE)
Remark
The camera type supported by the NeptunC library is defined with the “ENeptuneDevType”
enumeration declared in the “NeptuneDev.h” as below
enum ENeptuneDevType
{
NEPTUNE_DEV_TYPE_UNKNOWN = -1, // unknown camera
NEPTUNE_DEV_TYPE_GIGE = 0, // GigE camera
NEPTUNE_DEV_TYPE_1394 = 1, // 1394 camera
NEPTUNE_DEV_TYPE_USB3 = 2, // USB3 Vision camera
};
Example
ref. NeptuneC Library\Samples\C++\0.SingleAcquisition
ENeptuneDevType eType;
ntcGetCameraType(&eType);
if ( eType == NEPTUNE_DEV_TYPE_GIGE )
{
// do something
}
else if ( eType == NEPTUNE_DEV_TYPE_1394 )
{
// do something
}
Else if ( eType == NEPTUNE_DEV_TYPE_USB3 )
{
// do something
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 20
See Also
ntcOpen
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 21
4.3.4 ntcSetHeartbeatTime
Description
Set the heartbeat time of GigE camera.
Definition
ENeptuneError ntcSetHeartbeatTime(NeptuneCamHandle hCamHandle, _ulong32_t nTime)
Parameters
[IN] hCamHandle : camera handle
[IN] nTime : heartbeat time(mili-second unit)
Remark
The GigE camera needs periodic transaction to the camera and camera connection is closed if the
transaction is not happen in heartbeat time period. The NeptuneC API starts periodic transaction with 3
seconds to the GigE camera when user calls “ntcOpen” function. And user can change the heartbeat
time with the “ntcSetHeartbeatTime” function.
Especially while debugging the application, the camera connection may be closed if the debugger stops
the API process when breakpoint is activated. In this case user can avoid camera disconnection by
setting large heartbeat time.
Example
NeptuneCamHandle hCamHandle;
if ( ntcOpen(pCamInfo[0].strCamID, &hCamHandle) == NEPTUNE_ERR_Success )
{
ENeptuneDevType eType;
ntcGetCameraType(hCamHandle, &eType);
if ( eType == NEPTUNE_DEV_TYPE_GIGE )
ntcSetHeartbeatTime(hCamHandle, 10000); // set 10 seconds
}
See Also
ntcOpen, ntcGetCameraType
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 22
4.3.5 ntcSetUnplugCallback
Description
Register the callback function which is called when camera is disconnected.
Definition
ENeptuneError ntcSetUnplugCallback(NeptuneCamHandle hCamHandle,
NeptuneCUnplugCallback unplugCallback,
void* pContext)
Parameters
[IN] hCamHandle : camera handle
[IN] unplugCallback : callback function
[IN] pContext : user parameter passed to the callback function
Remark
User can detect disconnection of camera which is being controlled by register the callback function with
this API function. User should not call the “nctClose” in the callback function and just initialize the
camera handle.
Please refer to the “NeptuneCPlugUnplug” sample for details.
Example
ref. NeptuneC Library\Samples\C++\GUI\0.App
void UnplugCallback(void *pContext)
{
CAppDlg *pDlg = (CAppDlg *);
pDlg->m_hCamHandle = NULL;
}
ntcOpen(strCamID, &m_hCamHandle);
ntcSetUnplugCallback(m_hCamHandle, UnplugCallback, this);
See Also
ntcSetDeviceCheckCallback
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 23
4.3.6 ntcShowControlDialog
Description
Show the camera control dialog.
Definition
ENeptuneError ntcShowControlDialog(NeptuneCamHandle hCamHandle)
Parameters
[IN] hCamHandle : camera handle
Remark
The NeptuneC API includes dialog which has camera information including pixel format, frame rate,
trigger, feature control and xml control. User can show the control dialog with this finction.
Example
ref. NeptuneC Library\Samples\C++\GUI\0.App
ntcShowControlDialog(hCamHandle);
See Also
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 24
4.3.7 ntcSetPacketResend
Description
Control GigE camera to send dropped stream packet.
Definition
ENeptuneError ntcSetPacketResend(NeptuneCamHandle hCamHandle,
ENpetuneBoolean eEnableResend)
Parameters
[IN] hCamHandle : camera handle
[IN] eEnableResend : state of packet resend
Remark
User can control GigE camera with this function to send dropped stream packet if he wants. This API
function should be called in prior to the “ntcSetAcquisition” function.
Example
ntcOpen(strCamID, &m_hCamHandle); // open camera
ntcSetPacketResend(m_hCamHandle, NEPTUNE_BOOL_TRUE); // set packet resend
ntcSetAcquisition(m_hCamHandle, NEPTUNE_BOOL_TRUE); // play camera
See Also
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 25
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 26
4.4.1 ntcGetPixelFormatList
Description
Get the list of pixel format supported by a camera.
Definition
ENeptuneError ntcGetPixelFormatList(NeptuneCamHandle hCamHandle,
ENeptunePixelFormat* peList, _uint32_t* pnSize)
Parameters
[IN] hCamHandle : camera handle
[OUT] peList : list of pixel format
[IN/OUT] pnSize : size of the list
Remark
The default pixel format of a camera may be undefined when a camera is power on. User has to select
the pixel format he wants among the pixel formats camera supports. The NeptuneC API defines pixel
format with the “ENeptunePixelFormat” enumeration and it is declared in the “NetuneDef.h”.
enum ENeptunePixelFormat {
Unknown_PixelFormat = -1,
// 1394 Camera pixel format list.
Format0_320x240_YUV422 = 0,
Format0_640x480_YUV411 = 1,
Format0_640x480_YUV422 = 2,
Format0_640x480_Mono8 = 3,
Format0_640x480_Mono16 = 4,
Format1_800x600_YUV422 = 5,
Format1_800x600_Mono8 = 6,
Format1_1024x768_YUV422 = 7,
Format1_1024x768_Mono8 = 8,
Format1_800x600_Mono16 = 9,
Format1_1024x768_Mono16 = 10,
Format2_1280x960_YUV422 = 11,
Format2_1280x960_Mono8 = 12,
Format2_1600x1200_YUV422 = 13,
Format2_1600x1200_Mono8 = 14,
Format2_1280x960_Mono16 = 15,
Format2_1600x1200_Mono16 = 16,
Format7_Mode0_Mono8 = 17,
Format7_Mode0_YUV411 = 18,
Format7_Mode0_YUV422 = 19,
Format7_Mode0_Mono16 = 20,
Format7_Mode0_Raw8 = 21,
Format7_Mode0_Raw16 = 22,
Format7_Mode0_Mono12 = 23,
Format7_Mode0_Raw12 = 24,
Format7_Mode1_Mono8 = 25,
Format7_Mode1_YUV411 = 26,
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 27
Format7_Mode1_YUV422 = 27,
Format7_Mode1_Mono16 = 28,
Format7_Mode1_Raw8 = 29,
Format7_Mode1_Raw16 = 30,
Format7_Mode1_Mono12 = 31,
Format7_Mode1_Raw12 = 32,
Format7_Mode2_Mono8 = 33,
Format7_Mode2_YUV411 = 34,
Format7_Mode2_YUV422 = 35,
Format7_Mode2_Mono16 = 36,
Format7_Mode2_Raw8 = 37,
Format7_Mode2_Raw16 = 38,
Format7_Mode2_Mono12 = 39,
Format7_Mode2_Raw12 = 40,
As listed above, the pixel format supported by the 1394 camera and GigE camera is different.
User can know the size of the pixel format supported by a camera by calling the “ntcGetPixelFormatList”
function with second parameter as “NULL”. If the send parameter is “NULL”, the API function only
returns the size of pixel format supported. Call again the “ntcGetPixelFormatList” function after
allocation the list as much as returned size.
Example
ref. NeptuneC Library\Samples\C++\GUI\0.App
ENeptunePixelFormat* pFormatList = NULL;
_uint32_t nSize = 0;
if ( ntcGetPixelFormatList(hCamHandle, NULL, &nSize) == NEPTUNE_ERR_Success )
{
pFormatList = new ENeptunePixelFormat[nSize];
ntcGetPixelFormatList(hCamHandle, pFormatList, &nSize);
}
See Also
ntcGetPixelFormat, ntcSetPixelFormat
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 28
4.4.2 ntcGetPixelFormat
Description
Get the current pixel format from a camera.
Definition
ENeptuneError ntcGetPixelFormat(NeptuneCamHandle hCamHandle,
ENeptunePixelFormat* peFormat)
Parameters
[IN] hCamHandle : camera handle
[OUT] peFormat : pixel format
Remark
This function is used the get the current pixel format of a cmera.
Example
ref. NeptuneC Library\Samples\C++\GUI\0.App
ENeptunePixelFormat eFormat;
ntcGetPixelFormat(hCamHandle, &eFormat);
See Also
ntcGetPixelFormatList, ntcSetPixelFormat
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 29
4.4.3 ntcGetPixelFormatString
Description
Get the string value from the pixel format enumeration(ENeptunePixelFormat).
Definition
ENeptuneError ntcGetPixelFormatString(NeptuneCamHandle hCamHandle,
const ENeptunePixelFormat eFormat,
_char_t* pStr, _uint32_t nSize)
Parameters
[IN] hCamHandle : camera handle
[IN] eFormat : pixel format enumeration value
[OUT] pStr : string
[IN/OUT] nSize : size of the string
Remark
User can get the string value from the pixel format enumeration. The string is converted like as the
enumeration value passed to the function. For example, the string “Format0_640x480_YUV422” is
returned if the input enumeration value is Format0_640x480_YUV422.
Example
ref. NeptuneC Library\Samples\C++\GUI\0.App
ENeptunePixelFormat Format;
ntcGetPixelFormat(hCamHandle, &Format);
_char_t str[128];
ntcGetPixelFormatString(hCamHandle, Format, str, 128);
See Also
ntcGetPixelFormatList, ntcGetPixelFormat
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 30
4.4.4 ntcSetPixelFormat
Description
Set pixel format to a camera.
Definition
ENeptuneError ntcSetPixelFormat(NeptuneCamHandle hCamHandle,
const ENeptunePixelFormat eFormat)
Parameters
[IN] hCamHandle : camera handle
[IN] eFormat : pixel format value
Remark
The camera may not transfer correct image data if the pixel format is not set. So, user should set the
pixel format want to receive after selecting the camera.
Example
ref. NeptuneC Library\Samples\C++\0.SingleAcquisition
ntcSetPixelFormat(hCamHandle, Format0_640x480_YUV422);
See Also
ntcGetPixelFormatList, ntcGetPixelFormat
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 31
4.4.5 ntcGetBitsPerPixel
Description
Get the number of bits per pixel for a given pixel format.
Definition
ENeptuneError ntcGetBitsPerPixel(NeptuneCamHandle hCamHandle, _uint32_t* pnBits)
Parameters
[IN] hCamHandle : camera handle
[OUT] pnBits : data bits
Remark
The number of bits per pixel is the amount needed to express one pixel and it varies according to the
pixel format. For example, the number of bits per pixel is 8 for “Mono8” pixel format while the number
of bits per pixel is 16 for “Mono16”.
Example
ref. NeptuneC Library\Samples\C++\0.SingleAcquisition
ntcSetPixelFormat(hCamHandle, Mono8);
_uint32_t nBits;
ntcGetBitsPerPixel(hCamHandle, &nBits);
See Also
ntcGetPixelFormat, ntcSetPixelFormat
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 32
4.4.6 ntcGetFrameRateList
Description
Get the list of frame rate supported for a given pixel format.
Definition
ENeptuneError ntcGetFrameRateList(NeptuneCamHandle hCamHandle,
ENeptuneFrameRate* peList, _uint32_t* pnSize)
Parameters
[IN] hCamHandle : camera handle
[OUT] peList : list of frame rate
[IN/OUT] pnSize : size of the list
Remark
User should set the frame rate after selecting the pixel format because the supported frame rate may
vary according to the pixel format for 1394 camera. But, for GigE and USB3 camera, it is not needed to
set the frame rate in advance.
The supported frame rate by the NeptuneC API is defined with “ENeptuneFrameRate” enumeration
declared in the “NeptuneDef.h”.
enum ENeptuneFrameRate {
FPS_UNKNOWN = -1,
FPS_1_875 = 0, // 1.875 frame (1394 camera)
FPS_3_75 = 1, // 3.75 frame (1394 camera)
FPS_7_5 = 2, // 7.5 frame (1394 camera)
FPS_15 = 3, // 15 frame (1394 camera)
FPS_30 = 4, // 30 frame (1394 camera)
FPS_60 = 5, // 60 frame (1394 camera)
FPS_120 = 6, // 120 frame (1394 camera)
FPS_240 = 7, // 240 frame (1394 camera)
FPS_VALUE = 20 // frame rate value(GigE and USB3 camera)
};
As defined above, from “FPS_1_875” to “FPS_240” enumeration value is used for 1394 camera and
“FPS_VALUE” is used for the GigE and USB3 camera.
This API function returns the list of enumeration value and it returns the size of supported frame rate
list if called with second parameter as “NULL”. User can get the list of frame rate by calling againg this
function with second parameter as the pointer allocated.
Example
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 33
See Also
ntcSetPixelFormat, ntcGetFrameRate, ntcSetFrameRate
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 34
4.4.7 ntcGetFrameRate
Description
Get current frame rate from a camera.
Definition
ENeptuneError ntcGetFrameRate(NeptuneCamHandle hCamHandle,
ENeptuneFrameRate* peRate, _double_t* pfValue)
Parameters
[IN] hCamHandle : camera handle
[OUT] peRate : current frame rate value
[OUT] pfValue : current frame rate value(valid only if the peRate=FPS_VALUE, GigE and USB3 camera)
Remark
For 1394 camera, only the frame rate enumeration value is returned and the last parameter has no
meaning. For GigE and USB3 camera, the peRate is always returned as “FPS_VALUE” and current
frame rate is returned by the pfValue parameter.
Example
ref. NeptuneC Library\Samples\C++\GUI\0.App
ENeptuneFrameRate eRate;
_double_t fValue;
ntcGetFrameRate(hCamHandle, &eRate, &fValue);
if ( eRate == FPS_VALUE )
{
// GigE and USB3 camera
}
else
{
// 1394 camera
}
See Also
ntcGetFrameRate, ntcSetFrameRate
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 35
4.4.8 ntcGetFrameRateString
Description
Get the string from the frame rate enumeration value of 1394 camera.
Definition
ENeptuneError ntcGetFrameRateString(NeptuneCamHandle hCamHandle,
const ENeptuneFrameRate eRate,
_char_t* pStr, _uint32_t nSize)
Parameters
[IN] hCamHandle : camera handle
[IN] eRate : frame rate enumeration value
[OUT] pStr : string
[IN/OUT] nSize : size of the string
Remark
This API function is used for converting the enumeration value to string except the “FPS_VALUE”. The
converted string per enumeration is as below.
FPS_1_875 : “1.875”
FPS_3_75 : “3.75”
FPS_7_5 : “7.5”
FPS_15 : “15”
FPS_30 : “30”
FPS_60 : “60”
FPS_120 : “120”
FPS_240 : “240”
Example
ref. NeptuneC Library\Samples\C++\GUI\0.App
ENeptuneFrameRate eRate;
_double_t fValue;
_char_t str[128];
ntcGetFrameRate(hCamHandle, &eRate, &fValue);
if ( ntcGetFrameRateString(hCamHandle, eRate, str, 128) == NEPTUNE_ERR_Success )
{
}
See Also
ntcGetFrameRate, ntcSetFrameRate
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 36
4.4.9 ntcSetFrameRate
Description
Set the frame rate to a camera.
Definition
ENeptuneError ntcSetFrameRate(NeptuneCamHandle hCamHandle,
ENeptuneFrameRate eRate, _double_t fValue);
Parameters
[IN] hCamHandle : camera handle
[IN] eRate : frame rate enumeration value(eRate=FPS_VALUE for GigE and USB3 camera)
[IN] fValue : frame rate value(valid only for GigE and USB3 camera)
Remark
User can set the frame rate with this API function. For 1394 camera, only the “eRate” parameter has
meaning and the “fValue” parameter is ignored. For GigE and USB3 camera, the “eRate” parameter
should be “FPS_VALUE” and “fValue” parameter is the value want to set. A camera shoule be stopped
before setting the frame rate.
Example
ref. NeptuneC Library\Samples\C++\0.SingleAcquisition
ENeptuneDevType eType;
ntcGetCameraType(hCamHandle, &eType);
ntcSetAcquisition(hCamHandle, NEPTUNE_BOOL_FALSE);
if ( eType == NEPTUNE_DEV_TYPE_1394 )
ntcSetFrameRate(FPS_30, 0);
else
ntcSetFrameRate(FPS_VALUE, 15.0);
See Also
ntcGetFrameRateList, ntcGetFrameRate
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 37
4.4.10 ntcGetImageSize
Description
Get the size of an image of current pixel format.
Definition
ENeptuneError ntcGetImageSize(NeptuneCamHandle hCamHandle,
PNEPTUNE_IMAGE_SIZE pImageSize)
Parameters
[IN] hCamHandle : camera handle
[OUT] pImageSize : image size information
Remark
The size of an image may vary according to the pixel format. This API function returns the size
information under current pixel format with the “NEPTUNE_IMAGE_SIZE” structure declared in the
“NeptuneDef.h” as below.
struct NEPTUNE_IMAGE_SIZE {
_int32_t nStartX; // start point of X coordinate(width direction)
_int32_t nStartY; // start point of Y coordinate(height direction)
_int32_t nSizeX; // width
_int32_t nSizeY; // height
};
typedef NEPTUNE_IMAGE_SIZE* PNEPTUNE_IMAGE_SIZE;
Example
ref. NeptuneC Library\Samples\C++\0.SingleAcquisition
ntcSetPixelFormat(hCamHandle, Mono8);
NEPTUNE_IMAGE_SIZE imageSize;
ntcGetImageSize(hCamHandle, &imageSize);
See Also
ntcSetPixelFormat, ntcGetMaxImageSize, ntcSetImageSize
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 38
4.4.11 ntcGetMaxImageSize
Description
Get the maximum image size supported by the current pixel format.
Definition
ENeptuneError ntcGetMaxImageSize(NeptuneCamHandle hCamHandle,
PNEPTUNE_IMAGE_SIZE pImageSize)
Parameters
[IN] hCamHandle : camera handle
[OUT] pImageSize : maximum image size
Remark
As commented, the size of an image may vary acoording to the pixel format and this function returns
the maximum image size supported by the current pixel format.
For 1394 camera, the current image size and maximum image size is equal if the current pixel format is
fixed size mode (Format0_XXX, Format1_XXX, Format2_XXX). The current image size and maximum
image size may different for GigE and USB3 camera. And variable size pixel format mode(Format7_XXX
or ROI) of 1394 camera also may have different size and maximum size.
Example
ref. NeptuneC Library\Samples\C++\GUI\7.Advanced\Format7Control
ntcSetPixelFormat(hCamHandle, Mono8);
NEPTUNE_IMAGE_SIZE imageSize;
ntcGetMaxImageSize(hCamHandle, &imageSize);
See Also
ntcSetPixelFormat, ntcGetImageSize, ntcSetImageSize
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 39
4.4.12 ntcSetImageSize
Description
Set image size to a camera.
Definition
ENeptuneError ntcSetImageSize(NeptuneCamHandle hCamHandle,
NEPTUNE_IMAGE_SIZE ImageSize)
Parameters
[IN] hCamHandle : camera handle
[IN] ImageSize : image size
Remark
User can change image size with this API function.
For 1394 camera, variable size pixel format mode(Format7_XXX, ROI) should be set in advance to
change the image size. For GigE and USB3 camera, all pixel formats except binning support variable
size. The size range should be small or equal to the maximum image size.
Example
ref. NeptuneC Library\Samples\C++\GUI\7.Advanced\ Format7Control
NEPTUNE_IMAGE_SIZE imageSize;
imageSize.nStartX = 0;
imageSize.nStartY = 20;
imageSize.nSizeX = 320;
imageSize.nSizeY = 240;
ntcSetPixelFormat(hCamHandle, Mono8); // GigE and USB3 camera
ntcSetPixelFormat(hCamHandle, Format7_Mode0_Mono8) // 1394 camera
ntcSetImageSize(hCamHandle, imageSize);
See Also
ntcSetPixelFormat, ntcGetMaxImageSize, ntcGetImageSize
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 40
4.4.13 ntcGetBayerConvert
Description
Get the bayer conversion information.
Definition
ENeptuneError ntcGetBayerConvert(NeptuneCamHandle hCamHandle,
ENeptuneBayerMethod* peMethod)
Parameters
[IN] hCamHandle : camera handle
[OUT] peMethod : bayer conversion state
Remark
For color camera set as bayer pattern pixel format(XXX_Mono8, XXX_Mono16, BayerXX_8, BayerXX_10,
BayerXX_12), the API converts bayer pattern image to color image according to the conversion flag. If
the bayer conversion is “Off”, then the bayter pattern image is look like as mono image. Please refer to
the camera manual for details about the bayer pattern.
This API function returns the bayer conversion state with the “ENeptuneBayerMethod” declared in the
“NeptuneDef.h”.
enum ENeptuneBayerMethod {
NEPTUNE_BAYER_METHOD_NONE = 0, // no bayer conversion
NEPTUNE_BAYER_METHOD_BILINEAR = 1, // bilinear conversion
NEPTUNE_BAYER_METHOD_HQ = 2, // HQ conversion
NEPTUNE_BAYER_METHOD_NEAREST = 3 // nearest conversion
};
The HQ conversion needs highest CPU power but shows high image quality compared to other
conversion method. And the nearest conversion comsumes lowest CPU power but shows poor image.
Example
ref. NeptuneC Library\Samples\C++\GUI\0.App
ntcSetPixelFormat(hCamHandle, Mono8);
ENeptuneBayerMethod eMethod;
ntcGetBayerConvert(hCamHandle, &eMethod);
See Also
ntcSetPixelFormat, ntcSetBayerConvert, ntcGetBayerLayour, ntcSetBayerLayout
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 41
4.4.14 ntcSetBayerConvert
Description
Set bayer conversion method.
Definition
ENeptuneError ntcSetBayerConvert(NeptuneCamHandle hCamHandle,
ENeptuneBayerMethod eMethod)
Parameters
[IN] hCamHandle : camera handle
[IN] eMethod : bayer conversion
Remark
User can use this API function to convert bayer pattern image to color image or not.
Example
ref. NeptuneC Library\Samples\C++\GUI\0.App
ntcSetPixelFormat(hCamHandle, Mono8);
ntcSetBayerConvert(hCamHandle, NEPTUNE_BAYER_METHOD_BILINEAR);
See Also
ntcSetPixelFormat, ntcGetBayerConvert, ntcGetBayerLayout, ntcSetBayerLayout
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 42
4.4.15 ntcGetBayerLayout
Description
Get the bayer patter layout used for conversion.
Definition
ENeptuneError ntcGetBayerLayout(NeptuneCamHandle hCamHandle,
ENeptuneBayerLayout* peLayout)
Parameters
[IN] hCamHandle : camera handle
[OUT] peLayout : bayer pattern layout
Remark
For bayer pattern, for color pattern layout is possible. The API convert bayer pattern image with the
layout correct to a camera. If the layout is not matched with the bayer data, the correct color is not
expressed even converted.
The bayer layout is controlled with the “ENeptuneBayerLayout” enumeration declared in the
“NeptuneDef.h” as below.
enum ENeptuneBayerLayout {
NEPTUNE_BAYER_GB_RG = 0, // GB/RG layout
NEPTUNE_BAYER_BG_GR = 1, // BG/GR layout
NEPTUNE_BAYER_RG_GB = 2, // RG/GB layout
NEPTUNE_BAYER_GR_BG = 3, // GR/BG layout
};
Example
ref. NeptuneC Library\Samples\C++\GUI\0.App
ntcSetPixelFormat(hCamHandle, BayerGR8);
ENeptuneBayerLayout eLayout;
ntcGetBayerLayout(hCamHandle, &eLayout);
See Also
ntcSetBayerLayout, ntcGetBayerConvert, ntcSetBayerConvert
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 43
4.4.16 ntcSetBayerLayout
Description
Set the bayer layout for conversion.
Definition
ENeptuneError ntcSetBayerLayout(NeptuneCamHandle hCamHandle,
ENeptuneBayerLayout ePattern)
Parameters
[IN] hCamHandle : camera handle
[IN] ePattern : bayer pattern layout
Remark
User can change the bayer pattern layout used for conversion. If the layout is not matched with image
data, correct color is not expressed.
Example
ref. NeptuneC Library\Samples\C++\GUI\0.App
ntcSetPixelFormat(hCamHandle, Mono8);
ntcSetBayerLayout(hCamHandle, NEPTUNE_BAYER_GB_RG);
See Also
ntcGetBayerLayout, ntcGetBayerConvert, ntcSetBayerConvert
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 44
4.4.17 ntcGetBytePerPacket
Description
Get the packet size under Format7 mode of 1394 camera.
Definition
ENeptuneError ntcGetBytePerPacket(NeptuneCamHandle hCamHandle,
_uint32_t *pnBpp,
_uint32_t* pnMin=NULL, _uint32_t* pnMax=NULL)
Parameters
[IN] hCamHandle : camera handle
[OUT] pnBpp : current byte per packet value
[OUT, Optional] pnMin : minimum byte per packet value supported
[OUT, Optional] pnMax : maximum byte per packet value supported
Remark
This API function is used for 1394 camera only and is user for variablze size pixel format mode
(Format7_XXX). The byte per packet is used to control frame rate under the variable size pixel format
mode (Format7_XXX) of 1394 camera.
Example
ref. NeptuneC Library\Samples\C++\GUI\7.Advanced\ Format7Control
ntcSetPixelFormat(hCamHandle, Format7_Mode0_Mono8);
_uint32_t nBpp, nBppMin, nBppMax;
ntcGetBytePerPacket(hCamHandle, &nBpp, &nBppMin, &nBppMax);
See Also
ntcSetBytePerPacket, ntcSetPixelFormat
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 45
4.4.18 ntcSetBytePerPacket
Description
Set byte per packet to a 1394 camera.
Definition
ENeptuneError ntcSetBytePerPacket(NeptuneCamHandle hCamHandle, _uint32_t nBpp)
Parameters
[IN] hCamHandle : camera handle
[IN] nBpp : byte per packet value
Remark
This API function is used for 1394 camera only and is user for variablze size pixel format mode
(Format7_XXX). Use can adjust frame rate by controlling the byte per packet value uder variable size
pixel format mode.
Example
ref. NeptuneC Library\Samples\C++\GUI\7.Advanced\ Format7Control
ntcSetPixelFormat(hCamHandle, Format7_Mode0_Mono8);
ntcSetBytePerPacket(hCamHandle, 2500);
See Also
ntcGetBytePerPacket, ntcSetPixelFormat
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 46
4.4.19 ntcGetPacketSize
Description
Get the size of one packet for a GigE camera.
Definition
ENeptuneError ntcSetPacketSize(NeptuneCamHandle hCamHandle,
_uint32_t* pnPacketSize,
_uint32_t* pnMin=NULL, _uint32_t* pnMax=NULL)
Parameters
[IN] hCamHandle : camera handle
[OUT] pnPacketSize : current packet size
[OUT, Optional] pnMin : minimum packet size supported
[OUT, Optional] pnMax : maximum packet size supported
Remark
This function is used for GigE camera only and returns the size information of the packet for one
transmission.
The size of packet can be received in the system is dependent to the network card attached to the
system. If the camera stream is not received, then try to adjut the packet size with the
“ntcSetPacketSize” function.
Example
ntcSetPixelFormat(hCamHandle, Mono8);
_uint32_t nValue, nMin, nMax;
ntcGetPacketSize(hCamHandle, &nValue, &nMin, &nMax);
See Also
ntcSetPacketSize
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 47
4.4.20 ntcSetPacketSize
Description
Set the size of one packet for a GigE camera.
Definition
ENeptuneError ntcSetPacketSize(NeptuneCamHandle hCamHandle, _uint32_t nPacketSize)
Parameters
[IN] hCamHandle : camera handle
[IN] nPacketSize : packet size
Remark
This function is used for GigE camera only and user can adjust the size of the packet for one
transmission.
The size of packet can be received in the system is dependent to the network card attached to the
system. If the camera stream is not received, then try to adjut the packet size transmitted from a
camera. “1500” and “800” is used in general.
Example
ntcSetPixelFormat(hCamHandle, Mono8);
ntcSetPacketSize(hCamHandle, 1500);
See Also
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 48
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 49
4.5.1 ntcGetAcquisitionMode
Description
Get the camera’s data transfer method.
Definition
ENeptuneError ntcGetAcquisitionMode(NeptuneCamHandle hCamHandle,
ENeptuneAcquisitionMode* peMode,
_uint32_t* pnFrames)
Parameters
[IN] hCamHandle : camera handle
[OUT] peMode : data transfer method
[OUT] pnFrames : number of frames for multi-frame
(valid only when the peMode=NEPTUNE_ACQ_MULTIFRAME)
Remark
Camera can sequence out image in three ways – single-frame, multi-frame, continuous and user can
select one method with this API function. The transfer method is defined as “ENeptuneAcquisitionMode”
enumeration which is declared in the “NeptuneDef.h”.
The last parameter is valid only when the second parameter “peMode” is
“NEPTUNE_ACQ_MULTIFRAME” and it means the number of frames per one transfer.
enum ENeptuneAcquisitionMode {
NEPTUNE_ACQ_CONTINUOUS = 0, // continuous
NEPTUNE_ACQ_MULTIFRAME = 1, // multi frame
NEPTUNE_ACQ_SINGLEFRAME = 2, // single frame
};
Example
ENeptuneAcquisitionMode eMode;
_uint32_t nFrames;
ntcGetAcquisitionMode(hCamHandle, &eMode, &nFrames);
See Also
ntcSetAcquisitionMode, ntcGetAcquisition, ntcSetAcquisition
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 50
4.5.2 ntcSetAquisitionMode
Description
Set the way camera transfer image.
Definition
ENeptuneError ntcSetAcquisitionMode(NeptuneCamHandle hCamHandle,
ENeptuneAcquisitionMode eMode,
_uint32_t nFrames=2);
Parameters
[IN] hCamHandle : camera handle
[IN] eMode : transfer method
[IN, Optional] nFrames : number of frames
(valid only when eMode=NEPTUNE_ACQ_MULTIFRAME)
Remark
User can select the method camera transfer image data. In single-frame and multi-frame mode, user
has to control camera to send image agina when a camera finishes transfer. The NeptuneC API set
camera with continuous mode as default.
Example
ntcSetAcquisitionMode(hCamHandle, NEPTUNE_ACQ_SINGLEFRAME); // single frame
ntcSetAcquisitionMode(hCamHandle, NEPTUNE_ACQ_MULTIFRAME, 100); // multi frame
ntcSetAcquisitionMode(hCamHandle, NEPTUNE_ACQ_CONTINUOUS); // continuous
See Also
ntcGetAcquisitionMode, ntcGetAcquisition, ntcSetAcquisition
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 51
4.5.3 ntcOneShot
Description
Control camera to transfer single image.
Definition
ENeptuneError ntcOneShot(NeptuneCamHandle hCamHandle)
Parameters
[IN] hCamHandle : camera handle
Remark
User has to set camera as a one-shot(single frame) mode(NEPTUNE_ACQ_SINGLEFRAME) with the
“ntcSetAcquisitionMode” function before calling this function.
Example
ntcSetAcquisitionMode(hCamHandle, NEPTUNE_ACQ_SINGLEFRAME);
ntcSetAcquisition(hCamHandle, NEPTUNE_BOOL_TRUE);
ntcOneShot(hCamHandle);
See Also
ntcSetAcquisitonMode, ntcSetAcquisition
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 52
4.5.4 ntcMultiShot
Description
Control camera to transfer multiple images.
Definition
ENeptuneError ntcMultiShot(NeptuneCamHandle hCamHandle)
Parameters
[IN] hCamHandle : camera handle
Remark
User has to set camera as a multi-shot(multi frame) mode(NEPTUNE_ACQ_MULTIFRAME) and number
of frames to transfer with the “ntcSetAcquisitionMode” function before calling this function.
Example
ntcSetAcquisitionMode(hCamHandle, NEPTUNE_ACQ_MULTIFRAME, 10);
ntcSetAcquisition(hCamHandle, NEPTUNE_BOOL_TRUE);
ntcMultiShot(hCamHandle);
See Also
ntcSetAcquisitionMode, ntcSetAcquisition
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 53
4.5.5 ntcSetBufferCount
Description
Set the number of buffers of API.
Definition
ENeptuneError ntcSetBufferCount(NeptuneCamHandle hCamHandle, _uint32_t nCount)
Parameters
[IN] hCamHandle : camera handle
[IN] nCount : number of buffer
Remark
The NeptuneC API uses 10 frame buffers internally as default. User can change the number of buffer
with this API function. The number of buffer should be greater or queal to 3 and must be set before
cotrolling camera to send image data with “ntcSetAquisition”.
Example
ntcSetBufferCount (hCamHandle,5);
See Also
ntcSetAcquisition
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 54
4.5.6 ntcGetBufferSize
Description
Get the size of an image frame data.
Definition
ENeptuneError ntcGetBufferSize(NeptuneCamHandle hCamHandle, _uint32_t* pnSize)
Parameters
[IN] hCamHandle : camera handle
[OUT] pnSize : size of an image data
Remark
This API function returns the size of an image data in byte unit. User has to call this function after
setting the pixel format with “ntcSetPixelFormat” function. The returned size is used when calling the
“ntcSetUserBuffer” function.
Example
ref. NeptuneC Library\Samples\C++\0.SingleAcquisition
_uint32_t nSize;
ntcSetPixelFormat(hCamHandle, Mono8);
ntcGetBufferSize(hCamHandle, &nSize);
See Also
ntcSetPixelFormat, ntcSetUserBuffer
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 55
4.5.7 ntcSetUserBuffer
Description
Assign user allocated buffer to the NeptuneC API.
Definition
ENeptuneError ntcSetUserBuffer(NeptuneCamHandle hCamHandle,
_void_t* pBuffer,
_uint32_t nSize,
_uint32_t nCount)
Parameters
[IN] hCamHandle : camera handle
[IN] pBuffer: pointer of use allocated buffer
[IN] nSize : size of an image data
[IN] nCount : number of frames( > 1)
Remark
This API function is used to assign user allocated buffer to the NeptuneC API. User has to allocate
buffer with the size nSize*nCount and has to call this function before calling the “ntcSetAquisition”
function. User can know the size need for an image with the “ntcGetBufferSize” function. The assigned
user buffer is valid until user calls the “ntcSetAcquisiton” with “NEPTUNE_BOOL_FALSE”. User should
handle allocation and free for the buffer.
Example
_uint32_t nSize;
_int8_t* pBuffer = NULL;
ntcSetPixelFormat(hCamHandle, Mono8);
ntcGetBufferSize(hCamHandle, &nSize);
pBuffer = new _int8_t[nSize];
ntcSetUserBuffer(hCamHandle, pBuffer, nSize, 5);
ntcSetAcquisition(hCamHandle, NEPTUNE_BOOL_TRUE);
See Also
ntcGetBufferSize, ntcSetAcquisition
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 56
4.5.8 ntcSetEffect
Description
Set the image effect.
Definition
ENeptuneError ntcSetEffect(NeptuneCamHandle hCamHandle, _int32_t nEffect)
Parameters
[IN] hCamHandle : camera handle
[IN] nEffect : image effect
Remark
The effect is applied only in display, RGB data, image capture and stream capture and is not applied
the raw data passed to the callback or grab function. The API supports three effects – flip, mirror,
negative and effects can be applied with combination also. The Effect is defined as below.
enum ENeptuneEffect {
NEPTUNE_EFFECT_NONE = 0,
NEPTUNE_EFFECT_FLIP = 0x01, // flip image
NEPTUNE_EFFECT_MIRROR = 0x02, // mirror
NEPTUNE_EFFECT_NEGATIVE = 0x04 // negative
};
Example
_int32_t effect = NEPTUNE_EFFECT_FLIP | NEPTUNE_EFFECT_MIRROR | NEPTUNE_EFFECT_NEGATIVE;
ntcSetEffect(hCamHandle, effect);
See Also
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 57
4.5.9 ntcGrab
Description
Capture a single frame data.
Definition
ENeptuneError ntcGrab(NeptuneCamHandle hCamHandle, PNEPTUNE_IMAGE pImage,
ENeptuneGrabFormat eGrabFormat, _uint32_t nTimeout=1000)
Parameters
[IN] hCamHandle : camera handle
[OUT] pImage : image data
[IN] eGrabFormat : grab format
[IN] nTimeout : wait time (in mili-second unit)
Remark
User can get a single image data at any time with this API function and user has to allocate memory
for image data with the size needed. This function never returns until image data is received from a
camera and returns error after “nTimeout” delay if it didn’t receive any image data.
User can select the data format to capture – raw and RGB with the third parameter.
The “NEPTUNE_IMAGE” structure and “ENeptuneGrabFormat” is defined as below.
struct NEPTUNE_IMAGE {
_uint32_t uiWidth; // image data width
_uint32_t uiHeight; // image data height
_uint32_t uiBitDepth; // data bits per pixel
enum ENeptuneGrabFormat
{
NEPTUNE_GRAB_RAW = 0,
NEPTUNE_GRAB_RGB = 1
};
Example
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 58
ntcGetImageSize(m_CamHandle, &ImageSize);
ntcGetBitsPerPixel(m_CamHandle, &nBits);
if ( m_cboGrabFormat.GetCurSel() == 0 ) // raw data grab
{
eGrabFormat = NEPTUNE_GRAB_RAW;
nFrameSize = (int)(ImageSize.nSizeX*ImageSize.nSizeY*(float)nBits/8);
}
else // RGB data grab
{
eGrabFormat = NEPTUNE_GRAB_RGB;
nFrameSize = ImageSize.nSizeX*ImageSize.nSizeY*3;
}
GrabImage.pData = new BYTE[nFrameSize];
memset(GrabImage.pData, 0, nFrameSize);
delete GrabImage.pData;
GrabImage.pData = NULL;
See Also
ntcGetImageSize, ntcGetBitsPerPixel, ntcSetFrameCallback
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 59
4.5.10 ntcSetFrameCallback
Description
Register frame callback function.
Definition
ENeptuneError ntcSetFrameCallback(NeptuneCamHandle hCamHandle,
NeptuneCFrameCallback callback, void* pContext=NULL)
Parameters
[IN] hCamHandle : camera handle
[IN] callback : frame callback function
[IN] pContext : user parameter passed to the callback function
Remark
Once registered, the API calls frame callback function whenever new image data is received from a
camera. The API allocates memory for image data internally and passes it as parameter of callback
function. After the callback is finished, the memory is freed by the API. Callback function is defined as
below and the “NEPTUNE_IMAGE” structure is same as explained in the ntcGrab section.
Example
ref. NeptuneC Library\Samples\C++\GUI\0.App
void FrameCallback(PNEPTUNE_IMAGE pImage, void *pContext)
{
_char_t strFileName[_MAX_PATH];
sprintf_s(strFileName, _MAX_PATH, "%02d_%02d(%02d_%02d_%02d_%03d).raw",
sysTime.wMonth, sysTime.wDay, sysTime.wHour,
sysTime.wMinute, sysTime.wSecond, sysTime.wMilliseconds);
float length;
if( pImage->uiBitDepth == 8 ) length = 1.0;
else if( pImage->uiBitDepth == 12 ) length = 2.0;
else if( pImage->uiBitDepth == 16 ) length = 2.0;
else if( pImage->uiBitDepth == 24 ) length = 3.0;
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 60
See Also
ntcGrab
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 61
4.5.11 ntcSetFrameDropCallback
Description
Register frame drop callback function.
Definition
ENeptuneError ntcSetFrameDropCallback(NeptuneCamHandle hCamHandle,
NeptuneCFrameDropCallback callback,
void* pContext=NULL)
Parameters
[IN] hCamHandle : camera handle
[IN] callback : frame drop callback function
[IN] pContext : user parameter passed to the callback function
Remark
The API calls registered frame drop callback function whenever it finds corrupted image data. So, user
can check the loss of data in transmission layer. Callback function is defined as below.
Example
void FrameDropCallback(void *pContext)
{
// do something
}
See Also
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 62
4.5.12 ntcSetDisplay
Description
Set display window to show image.
Definition
ENeptuneError ntcSetDisplay(NeptuneCamHandle hCamHandle, HWND hWnd)
Parameters
[IN] hCamHandle : camera handle
[IN] hWnd : window handle
Remark
The NeptunC API doesn’t have internal display and it displays only when user assigns display window
handle with this function. The display image is resized to fit in the window. This function should be
called before calling the “ntcSetAquisition”.
Example
ref. NeptuneC Library\Samples\C++\GUI\0.App
CWnd* pWnd = (CWnd*)GetDlgItem(IDC_PICTURE);
ntcSetDisplay(hCamHandle, pWnd->m_hWnd);
See Also
ntcSetAcquisition
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 63
4.5.13 ntcSetAcquisition
Description
Control camera to play or stop.
Definition
ENeptuneError ntcSetAcquisition(NeptuneCamHandle hCamHandle, ENeptuneBoolean eSate)
Parameters
[IN] hCamHandle : camera handle
[IN] eState : play/stop control
Remark
This function is used to control camera to transfer image data or not. The pixel format, frame rate an
display window if needed should be set in advance before calling this fuinction.
Example
ref. NeptuneC Library\Samples\C++\0.SingleAcquisition
// play
ntcSetAcquisition(hCamHandle, NEPTUNE_BOOL_TRUE);
// stop
ntcSetAcquisition(hCamHandle, NEPTUNE_BOOL_FALSE);
See Also
ntcGetAcquisition
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 64
4.5.14 ntcGetAcquisition
Description
Get the play/stop state of camera.
Definition
ENeptuneError ntcGetAcquisition(NeptuneCamHandle hCamHandle,
ENeptuneBoolean* peState)
Parameters
[IN] hCamHandle : camera handle
[OUT] peState : play/stop state
Remark
User can know the camera’s play status with this function.
Example
ref. NeptuneC Library\Samples\C++\GUI\0.App
ENeptuneBoolean eState;
ntcGetAcquisition(hCamHandle, &eState);
See Also
ntcSetAcquisition
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 65
4.5.15 ntcSetMulticastAddress
Description
Set the multicast address of GigE camera.
Definition
ENeptuneError ntcSetMulticastAddress(NeptuneCamHandle hCamHandle,
_char_t* pstrAddress)
Parameters
[IN] hCamHandle : camera handle
[IN] pstrAddress: multicast address
Remark
This API function is used to set the multicast address for GigE camera when a camera sends stream
with multicast. The multicast address should be set before calling the “ntcSetAcquisition” and should
be in range 239.0.0.0 ~ 239.255.255.255.
Example
ntcSetMulticastAddress(hCamHandle, “239.0.0.0”);
ntcSetAcquisition(;
See Also
ntcSetAcquisition
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 66
4.5.16 ntcGetReceiveFrameRate
Description
Get the real frame rate received.
Definition
ENeptuneError ntcGetReceiveFrameRate(NeptuneCamHandle hCamHandle,
_float32_t* pfRate)
Parameters
[IN] hCamHandle : camera handle
[OUT] pfRate : data receive rate
Remark
This API function returns calculated real receive frame rate.
Example
ref. NeptuneC Library\Samples\C++\GUI\0.App
_float32_t fRate;
ntcGetReceiveFrameRate(hCamHandle, &fRate);
See Also
ntcSetAcquisition
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 67
4.5.17 ntcGetRGBData
Description
Get the RGB image data.
Definition
ENeptuneError ntcGetRGBData(NeptuneCamHandle hCamHandle,
_uchar_t* pBuffer, _uint32_t nSize)
Parameters
[IN] hCamHandle : camera handle
[OUT] pBuffer : data buffer
[IN] nSize : size of buffer
Remark
If callback is used, user can get the RGB converted image data by calling this function in the frame
callback function. The RGB data is composed in “B-G-R” order and user should allocate the memory for
image data.
Example
ref. NeptuneC Library\Samples\C++\GUI\4.ImageCapture
void FrameCallback(PNEPTUNE_IMAGE pImage, void *pContext)
{
_uint32_t nSize = pImage->uiWidth*pImage->uiHeight*3;
_uchar_t *pBuf;
pBuf = new _uchar_t[nSize]
if ( ntcGetRGBData(hCamHandle, pBuf, nSize) == NEPTUNE_ERR_Success )
; // do something
delete pBuf;
}
See Also
ntcSetCallback
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 68
4.5.18 ntcSaveImage
Description
Save image data to an image.
Definition
ENeptuneError ntcSaveImage(NeptuneCamHandle hCamHandle,
_char_t* strFileName, _uint32_t nQuality=80)
Parameters
[IN] hCamHandle : camera handle
[IN] strFileName : save file name
[IN, Optional] nQuality : JPEG image quality
Remark
User can capture frame data to an image with this function as JPEG, TIFF or BMP format. User should
use the extension of file name “.jpg”, “.tif” or “.bmp” because the API identifies saving format with the
file name extension. User can set the quality of JPEG image with third parameter.
Example
ref. NeptuneC Library\Samples\C++\GUI\4.ImageCapture
sprintf_s(strFileName, _MAX_PATH, "%02d_%02d(%02d_%02d_%02d_%03d).bmp",
sysTime.wMonth, sysTime.wDay, sysTime.wHour,
sysTime.wMinute, sysTime.wSecond, sysTime.wMilliseconds);
ntcSaveImage(hCamHandle, strFileName);
See Also
ntcSetAcquisition
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 69
4.5.19 ntcStartStreamCapture
Description
Capture frame data to stream.
Definition
ENeptuneError ntcStartStreamCapture(NeptuneCamHandle hCamHandle,
_char_t* strFileName, _bool8_t bCompress,
_uint32_t nBitrate=1000)
Parameters
[IN] hCamHandle : camera handle
[IN] strFileName : stream file name
[IN] bCompress : compression flag
[IN, Optional] nBitrate : bitrate of compression
Remark
User can save frame data to AVI stream in compressed with H264 or uncompressed format with this
function.
Example
ref. NeptuneC Library\Samples\C++\GUI\4.ImageCapture
// compressed AVI
ntcStartStreamCapture(hCamHandle, “capture.avi”, NEPTUNE_BOOL_TRUE);
// uncompressed AVI
ntcStartStreamCapture(hCamHandle, “capture.avi”, NEPTUNE_BOOL_FALSE);
See Also
ntcStopStreamCapture
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 70
4.5.20 ntcStopStreamCapture
Description
Stop stream capture.
Definition
ENeptuneError ntcStopStreamCapture(NeptuneCamHandle hCamHandle)
Parameters
[IN] hCamHandle : camera handle
Remark
This API function stops AVI stream capture.
Example
ref. NeptuneC Library\Samples\C++\GUI\4.ImageCapture
ntcStopStreamCapture(hCamHandle);
See Also
ntcStartStreamCapture
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 71
4.5.21 ntcSetRecvDroppedFrame
Description
Controls receiving of broken image frame.
Definition
ENeptuneError ntcSetRecvDroppedFrame(NeptuneCamHandle hCamHandle,
ENeptuneBoolean eRecvDroppedFrame)
Parameters
[IN] hCamHandle : camera handle
[IN] eRecvDroppedFrame : control flag
Remark
This control flag with API function should be set before calling the “ntcSetAcquisition” function.
Example
if ( want to receive )
ntcSetRecvDroppedFrame(hCamHandle, NEPTUNE_BOOL_TRUE); // receive broken frame
else
ntcSetRecvDroppedFrame(hCamHandle, NEPTUNE_BOOL_FALSE); // don’t receive broken frame
ntcSetAcquisition(hCamHandle, NEPTUNE_BOOL_TRUE); // play camera
See Also
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 72
4.5.22 ntcSetRotation
Description
Set rotation angle to an image.
Definition
ENeptuneError ntcSetRotation(NeptuneCamHandle hCamHandle,
ENeptuneRotationAngle eRotationAngle)
Parameters
[IN] hCamHandle : camera handle
[IN] eRecvDroppedFrame : rotation angle
Remark
enum ENeptuneRotationAngle
{
NEPTUNE_ROTATE_0 = 0, // 0 degree
NEPTUNE_ROTATE_90 = 1, // 90 degree
NEPTUNE_ROTATE_180 = 2, // 180 degree
NEPTUNE_ROTATE_270 = 3 // 270 degree
};
The rotation in display is applied only when the DirectX device is usable. If the DirectX device is not
successful, then the display rotation is not used. The API suppored rotation angle is 0, 90, 180 and 270
degree and it rotates image to clock wise direction if enabled. The “ENeptuneRotationAngle”
enumeration value is deinfed in the “NeptuneDef.h”.
The Rotation is applied all images including RGB data, save image format(BMP, JPG, TIF) and AVI
except raw data.
Example
ntcSetAcquisition(hCamHandle, NEPTUNE_BOOL_TRUE); // receive broken frame
ntcSetRotation(hCamHandle, NEPTUNE_ROTATE_90); // rotate 90 degree to clockwise direction
See Also
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 73
enum ENeptuneFeature {
NEPTUNE_FEATURE_GAMMA = 0, // AnalogControls, Gamma
NEPTUNE_FEATURE_GAIN = 1, // AnalogControls, Gain or GainRaw
NEPTUNE_FEATURE_RGAIN = 2, // AnalogControls, Gain or GainRaw
NEPTUNE_FEATURE_GGAIN = 3, // AnalogControls, Gain or GainRaw
NEPTUNE_FEATURE_BGAIN = 4, // AnalogControls, Gain or GainRaw
NEPTUNE_FEATURE_BLACKLEVEL = 5, // AnalogControls, BlackLevel or BlackLevelRaw
NEPTUNE_FEATURE_SHARPNESS = 6, // AnalogControls, Sharpness or SharpnessRaw
NEPTUNE_FEATURE_SATURATION = 7, // AnalogControls, Saturation or SaturationRaw
NEPTUNE_FEATURE_AUTOEXPOSURE = 8, // AcquisitionControl, AutoExposure
NEPTUNE_FEATURE_SHUTTER = 9, // AcquisitionControl, ExposureTime
NEPTUNE_FEATURE_HUE = 10, // AnalogControls, Hue or HueRaw
NEPTUNE_FEATURE_PAN = 11, // AcquisitionControl, PanCtrl
NEPTUNE_FEATURE_TILT = 12, // AcquisitionControl, TiltCtrl
NEPTUNE_FEATURE_OPTFILTER = 13, // AnalogControls, OpticalFilter
NEPTUNE_FEATURE_AUTOSHUTTER_MIN = 14, // CustomControl, AutoShutterSpeedMin
NEPTUNE_FEATURE_AUTOSHUTTER_MAX = 15, // CustomControl, AutoShutterSpeedMin
NEPTUNE_FEATURE_AUTOGAIN_MIN = 16, // CustomControl, AutoGainMin
NEPTUNE_FEATURE_AUTOGAIN_MAX = 17, // CustomControl, AutoGainMax
NEPTUNE_FEATURE_TRIGNOISEFILTER = 18, // CustomControl, TriggerNoiseFilter
NEPTUNE_FEATURE_BRIGHTLEVELIRIS = 19, // CustomControl, BrightLevelForIRIS
NEPTUNE_FEATURE_SNOWNOISEREMOVE = 20, // CustomControl, SnowNosieRemoveControl
NEPTUNE_FEATURE_WATCHDOG = 21, // CustomControl, WDGControl
NEPTUNE_FEATURE_WHITEBALANCE = 22, // AnalogControls, BalanceWhiteAuto
NEPTUNE_FEATURE_CONTRAST = 23, // CustomControl, Contrast
NEPTUNE_FEATURE_LCD_BLUE_GAIN = 24, // CustomControl, LCD_BLUE_GAIN
NEPTUNE_FEATURE_LCD_RED_GAIN = 25, // CustomControl, LCD_RED_GAIN
};
Information of each feature is passed with the “NEPTUNE_FEATURE” structure as defined below.
struct NEPTUNE_FEATURE {
ENeptuneBoolean bSupport;
ENeptuneBoolean bOnOff; // on/off state, on/off control(SnowNoiseRemove only)
_uint8_t SupportAutoModes; // bit flag for support(bit0:Off, bit1:Once, bit2:Continuous)
ENeptuneAutoMode AutoMode; // current Auto mode, valid only when "SupportAutoModes != 0"
_int32_t Min; // minimum value
_int32_t Max; // maximum value
_int32_t Inc; // increment step
_int32_t Value; // current value
ENeptuneNodeAccessMode ValueAccessMode; // access state of the value
};
typedef NEPTUNE_FEATURE* PNEPTUNE_FEATURE;
In this structure, the “bSupport” element indicates whether the feature is supported or not and the “bOnOff”
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 74
feature means the on and off state of feature. The “SupportAutoMode” element means whether auto mode is
supported or not with bit flag as below.
The “AutoMode”, “Min”, “Max”, “Inc” and “Value” elements represent current auto mode, value and range. User
uses “Value” and “AutoMode” to set a feature.
The “NEPTUNE_FEATURE_RGAIN”, “NEPTUNE_FEATURE_GGAIN”, “NEPTUNE_FEATURE_BGAIN” is interlocked
with the “NEPTUNE_FEATURE_WHITBALANCE”. As those color gains are controllable only if the
“NEPTUNE_FEATURE_WHITEBALANCE” feature in manual mode, use should check the “WhiteBalance” feature
when controls color gains. For “NEPTUNE_FEATURE_WHITEBALANCE”, only the “AutoMode” is used to set the
value.
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 75
4.6.1 ntcGetFeature
Description
Get the support and value of given feature.
Definition
ENeptuneError ntcGetFeature(NeptuneCamHandle hCamHandle, ENeptuneFeature eFeature,
PNEPTUNE_FEATURE pInfo)
Parameters
[IN] hCamHandle : camera handle
[IN] eFeature : feature ID
[OUT] pInfo : feature information
Remark
User can know the support, value and range with this API function.
Example
ref. NeptuneC Library\Samples\C++\GUI\6.Feature
NEPTUNE_FEATURE FeatureInfo;
// current value
int nValue = FeatureInfo.Value;
// is controllable
if ( FeatureInfo.ValueAccessMode == NEPTUNE_NODE_ACCESSMODE_RO )
{
// can not control
}
else
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 76
{
// controllable
}
See Also
ntcSetFeature
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 77
4.6.2 ntcSetFeature
Description
Set feature value and auto state.
Definition
ENeptuneError ntcSetFeature(NeptuneCamHandle hCamHandle, ENeptuneFeature eFeature,
NEPTUNE_FEATURE Info)
Parameters
[IN] hCamHandle : camera handle
[IN] Info : feature value and auto state
Remark
This API function is used to set the feature value and auto state. The color gains - “RGain”, “Gain”,
“BGain”, are not support auto and are not controllable if the “WhiteBalance” feature is auto state.
If auto state changed from auto to manual or from manual to auto, the value is not applied and only
the auto state is applied.
Example
ref. NeptuneC Library\Samples\C++\GUI\6.Feature
NEPTUNE_FEATURE FeatureInfo;
FeatureInfo.Value = 50;
ntcSetFeature(hCamHandle, NEPTUNE_FEATURE_GAIN, FeatureInfo);
See Also
ntcGetFeature
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 78
4.6.3 ntcSetShutterString
Description
Set shutter with string.
Definition
ENeptuneError ntcSetShutterString(NeptuneCamHandle hCamHandle, _char_t* pstrShutter)
Parameters
[IN] hCamHandle : camera handle
[IN] pstrShutter : shutter value string
Remark
This API function is used to set the shutter with real time value string. User can use this function or
“ntcSetFeature” to control the shutter value. The “pstrShutter” parameter should include time unit like
as “500us”, “1.2ms” or “5s” and both lower and upper case letters are accepted.
Example
ntcSetShutterString(hCamHandle, “500ms”);
See Also
ntcSetFeature
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 79
4.6.4 ntcGetAutoAreaControl
Description
Get region information used for auto functions – auto exposure, auto white balance and auto focus.
Definition
ENeptuneError ntcGetAutoAreaControl(NeptuneCamHandle hCamHandle,
ENeptuneAutoAreaSelect eSelect,
PNEPTUNE_AUTOAREA pArea)
Parameters
[IN] hCamHandle : camera handle
[IN] eSelect: feature name for getting area control information
[OUT] pArea : area control information
Remark
enum ENeptuneAutoAreaSelect
{
NEPTUNE_AUTOAREA_SELECT_AE = 0, // for AutoExposure
NEPTUNE_AUTOAREA_SELECT_AWB = 1, // for AutoWhiteBalance
NEPTUNE_AUTOAREA_SELECT_AF =2 // for AutoFocus
};
enum ENeptuneAutoAreaSize
{
NEPTUNE_AUTOAREA_SIZE_SELECTED = 0, // selected size
NEPTUNE_AUTOAREA_SIZE_FULL = 1, // full image size
};
struct NEPTUNE_AUTOAREA {
ENeptuneBoolean OnOff;
ENeptuneAutoAreaSize SizeControl;
NEPTUNE_IMAGE_SIZE AreaSize;
};
typedef NEPTUNE_AUTOAREA* PNEPTUNE_AUTOAREA;
This API function is used to get region information used for the auto functions – auto exposure, auto
white balance and auto focus. User can select one of auto function with the “ENeptuneAutoAreaSelect”
enumeration. The auto area information is passed with the “NEPTUNE_AUTOAREA” structure includes
“ENeptuneAutoAreaSize” enumeration and “NEPTUNE_IMAGE_SIZE” structure. The
“ENeptuneAutoAreaSize” enumeration value means that the auto algorithm is using whole image or
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 80
selected region.
Please refer to the camera manual for details about the auto area control.
Example
NEPTUNE_AUTOAREA AutoArea;
// Auto Exposure Area
ntcGetAutoAreaControl(hCamHandle,NEPTUNE_AUTOAREA_SELECT_AE, &AutoArea);
// Auto White Balance Area
ntcGetAutoAreaControl(hCamHandle,NEPTUNE_AUTOAREA_SELECT_AWB, &AutoArea);
// Auto Focus Area
ntcGetAutoAreaControl(hCamHandle,NEPTUNE_AUTOAREA_SELECT_AF, &AutoArea);
See Also
ntcSetAutoAreaControl
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 81
4.6.5 ntcSetAutoAreaControl
Description
Set region information used for auto function – auto exposure, auto white balance and auto focus.
Definition
ENeptuneError ntcSetAutoAreaControl(NeptuneCamHandle hCamHandle,
ENeptuneAutoAreaSelect eSelect,
NEPTUNE_AUTOAREA Area)
Parameters
[IN] hCamHandle : camera handle
[IN] eSelect: feature name for getting area control information
[IN] Area : area control information
Remark
enum ENeptuneAutoAreaSelect
{
NEPTUNE_AUTOAREA_SELECT_AE = 0, // for AutoExposure
NEPTUNE_AUTOAREA_SELECT_AWB = 1, // for AutoWhiteBalance
NEPTUNE_AUTOAREA_SELECT_AF =2 // for AutoFocus
};
enum ENeptuneAutoAreaSize
{
NEPTUNE_AUTOAREA_SIZE_SELECTED = 0, // selected size
NEPTUNE_AUTOAREA_SIZE_FULL = 1, // full image size
};
struct NEPTUNE_AUTOAREA {
ENeptuneBoolean OnOff;
ENeptuneAutoAreaSize SizeControl;
NEPTUNE_IMAGE_SIZE AreaSize;
};
typedef NEPTUNE_AUTOAREA* PNEPTUNE_AUTOAREA;
This API function is used to set specific region in an image used for the auto functions – auto exposure,
auto white balance and auto focus. User can select one of auto function with the
“ENeptuneAutoAreaSelect” enumeration. The auto area information is passed with the
“NEPTUNE_AUTOAREA” structure includes “ENeptuneAutoAreaSize” enumeration and
“NEPTUNE_IMAGE_SIZE” structure. The “ENeptuneAutoAreaSize” enumeration value means that the
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 82
Example
NEPTUNE_AUTOAREA Area;
Area.OnOff = NEPTUNE_BOOL_TRUE;
Area.SizeControl = NEPTUNE_AUTOAREA_SIZE_SELECTED;
Area.AreaSize.nStartX = 100;
Area.AreaSize.nStartY = 100;
Area.AreaSize.nSizeX = 500;
Area.AreaSize.nSizeY = 400;
ntcSetAutoAreaControl(hCamHandle, NEPTUNE_AUTOAREA_SELECT_AE, Area);
See Also
ntcGetAutoAreaControl
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 83
4.6.6 ntcSetAFControl
Description
Set Auto Focus operation mode.
Definition
ENeptuneError ntcSetAFControl(NeptuneCamHandle hCamHandle,
ENeptuneAFMode eControlMode)
Parameters
[IN] hCamHandle : camera handle
[IN] eControlMode: Auto Focus operation mode
Remark
This API function is used to control the Auto Focus to one-push auto and manual operation mode. User
can control the Auto Focus with the “ENeptuneAFMode” enumeration which is defined as below.
Please refer to the camera manual for details about the Auto Focus.
enum ENeptuneAFMode
{
NEPTUNE_AF_ORIGIN = 0, // set focus to origin point
NEPTUNE_AF_ONEPUSH = 1, // one-push auto focus
NEPTUNE_AF_STEP_FORWARD = 2, // move one step forward
NEPTUNE_AF_STEP_BACKWARD = 3 // move one step backward
};
Example
ref. NeptuneC Library\Samples\C++\GUI\7.Advanced\AFControl
ntcSetAFcontrol(hCamHandle, NEPTUNE_AF_ONEPUSH);
See Also
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 84
4.6.7 ntcSaveCameraParameter
Description
Save camera parameter to a file.
Definition
ENeptuneError ntcSaveCameraParameter(NeptuneCamHandle hCamHandle,
_char_t* pstrFileName)
Parameters
[IN] hCamHandle : camera handle
[IN] pstrFileName: file name to save camera parameter
Remark
This API function is used to save camera parameters to a file. All basic information including pixel
format, frame rate and feature values are saved to a file as below.
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 85
[Trigger Info]
TriggerOnOff=0 ; trigger on/off flag
TriggerMode=15 ; trigger mode
TriggerPolarity=1 ; trigger signal polarity
TriggerSource=0 ; trigger source
TriggerParameter=1 ; trigger parameter
TriggerDelay=1 ; trigger delay value
[Strobe Info]
StroberOnOff=0 ; strobe on/off flag
StrobeMode=1 ; strobe mode
StrobePolarity=3 ; strobe signal polarity
StrobeDelay=0 ; strobe delay value
StrobeDuration=2000 ; strobe duration value
Example
ntcSaveCameraParameter(hCamHandle, “camera_param.txt”);
See Also
ntcLoadCameraParameter
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 86
4.6.8 ntcLoadCameraParameter
Description
Load camera parameter from a file and write to a camera.
Definition
ENeptuneError ntcLoadCameraParameter(NeptuneCamHandle hCamHandle,
_char_t* pstrFileName)
Parameters
[IN] hCamHandle : camera handle
[IN] pstrFileName: file name to load camera parameter
Remark
This API function is used to load camera parameters from a file and write to a camera. The input file
should be on that is create with the “ntcSaveCameraParameter” function.
Example
ntcLoadCameraParameter(hCamHandle, “camera_param.txt”);
See Also
ntcSaveCameraParameter
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 87
4.6.9 ntcSetNTSCPALSelector
Description
Set video mode of a USB3 camera. (322UC)
Definition
ENeptuneError ntcSetNTSCPALSelector(NeptuneCamHandle hCamHandle,
ENeptuneVideoMode eVideoMode)
Parameters
[IN] hCamHandle : camera handle
[IN] eVideoMode : NTSC or PAL
Remark
In case of NTSC mode, frame rate of camera is set to 30 or 60. In case of PAL mode, frame rate of
camera is set to 25 or 50. ENeptuneVideMode is defined in "NeptuneDef.h" as follows:
enum ENeptuneVideoMode
{
NEPTUNE_VIDEOMODE_NTSC = 0,
NEPTUNE_VIDEOMODE_PAL = 1,
};
Example
ntcSetNTSCPALSelector(hCamHandle, NEPTUNE_VIDEOMODE_NTSC);
See Also
ntcGetNTSCPALSelector
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 88
4.6.10 ntcGetNTSCPALSelector
Description
Get video mode of a USB3 camera. (322UC)
Definition
ENeptuneError ntcGetNTSCPALSelector(NeptuneCamHandle hCamHandle,
ENeptuneVideoMode* peVideoMode)
Parameters
[IN] hCamHandle : camera handle
[OUT] peVideoMode : NTSC or PAL
Remark
Example
ENeptuneVideoMode eMode;
ntcGetNTSCPALSelector(hCamHandle, &eMode);
See Also
ntcSetNTSCPALSelector
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 89
4.6.11 ntcSetAcquisitionFrameRateSel
Description
Set acquisition fps of a USB3 camera. (322UC)
Definition
ENeptuneError ntcSetAcquisitionFrameRateSel(NeptuneCamHandle hCamHandle,
ENeptuneAcqFPS eFPS)
Parameters
[IN] hCamHandle : camera handle
[IN] eFPS : FPS_30or25 or FPS_60or50
Remark
It is only valid if the trigger mode is turned off. ENeptuneAcqFPS is defined in "NeptuneDef.h" as follows:
enum ENeptuneAcqFPS
{
NEPTUNE_FPS_30or25 = 0,
NEPTUNE_FPS_60or50 = 1,
};
Example
ntcSetAcquisitionFrameRateSel(hCamHandle, NEPTUNE_FPS_30or25);
See Also
ntcGetAcquisitionFrameRateSel, ntcGetAcquisitionFrameRateList
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 90
4.6.12 ntcGetAcquisitionFrameRateSel
Description
Get acquisition fps from a USB3 camera. (322UC)
Definition
ENeptuneError ntcGetAcquisitionFrameRateSel(NeptuneCamHandle hCamHandle,
ENeptuneAcqFPS* peFPS)
Parameters
[IN] hCamHandle : camera handle
[OUT] peFPS : FPS_30or25 or FPS_60or50
Remark
Example
ENeptuneAcqFPS eFPS;
ntcGetAcquisitionFrameRateSel(hCamHandle, &eFPS);
See Also
ntcSetAcquisitionFrameRateSel, ntcGetAcquisitionFrameRateList
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 91
4.6.13 ntcGetAcquisitionFrameRateList
Description
Get acquisition fps list from a USB3 camera. (322UC)
Definition
ENeptuneError ntcGetAcquisitionFrameRateList(NeptuneCamHandle hCamHandle,
ENeptuneAcqFPS* peList, _uint32_t* pnSize)
Parameters
[IN] hCamHandle : camera handle
[OUT] peList : List of supported frame rate
[IN/OUT] pnSize : Count of peList
Remark
This API function should be called twice. When count of pnSize is returned, the user can get a list of
frame rate after the array of peList is allocated as pnSize.
Example
ENeptuneAcqFPS* eFPSArr;
_uint32_t nSize = 0;
if( ntcGetAcquisitionFrameRateList(hCamHandle, eFPSArr, &nSize) == NEPTUNE_ERR_Success )
{
if( nSize > 0 )
ntcGetAcquisitionFrameRateList(hCamHandle, eFPSArr, &nSize);
}
See Also
ntcSetAcquisitionFrameRateSel, ntcGetAcquisitionFrameRateSel
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 92
4.6.14 ntcSetResolutionSelector
Description
Set resolution of a USB3 camera. (322UC)
Definition
ENeptuneError ntcSetResolutionSelector(NeptuneCamHandle hCamHandle,
ENeptuneResolution eResolution)
Parameters
[IN] hCamHandle : camera handle
[IN] eResolution : 1920x1080 or 1280x720
Remark
You may select the resolution of the image by using this API function (1080p, 720p).
ENeptuneResolution is defined in "NeptuneDef.h" as follows:
enum ENeptuneResolution
{
NEPTUNE_RESOLUTION_1280x720 = 0,
NEPTUNE_RESOLUTION_1920x1080 = 1,
};
Example
ntcSetResolutionSelector(hCamHandle, NEPTUNE_RESOLUTION_1920x1080);
See Also
ntcGetResolutionSelector, ntcGetResolutionList
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 93
4.6.15 ntcGetResolutionSelector
Description
Get resolution from a USB3 camera. (322UC)
Definition
ENeptuneError ntcGetResolutionSelector(NeptuneCamHandle hCamHandle,
ENeptuneResolution* peResolution)
Parameters
[IN] hCamHandle : camera handle
[OUT] peResolution : 1920x1080 or 1280x720
Remark
Example
ENeptuneResolution eResolution;
ntcGetResolutionSelector(hCamHandle, &eResolution);
See Also
ntcSetResolutionSelector, ntcGetResolutionList
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 94
4.6.16 ntcGetResolutionList
Description
Get resolution list from a USB3 camera. (322UC)
Definition
ENeptuneError ntcGetResolutionList(NeptuneCamHandle hCamHandle,
ENeptuneResolution* peList, _uint32_t* pnSize)
Parameters
[IN] hCamHandle : camera handle
[OUT] peList : List of supported frame rate
[IN/OUT] pnSize : Count of peList
Remark
This API function should be called twice. When count of pnSize is returned, the user can get list of
resolution after the array of peList is allocated as pnSize.
Example
ENeptuneResolution* eResArr;
_uint32_t nSize = 0;
if( ntcGetResolutionList(hCamHandle, eResArr, &nSize ) == NEPTUNE_ERR_Success )
{
if( nSize > 0 )
ntcGetResolutionList(hCamHandle, eResArr, &nSize);
}
See Also
ntcSetResolutionSelector, ntcGetResolutionSelector
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 95
4.6.17 ntcSetDayNightModeSelector
Description
Set DayNight mode of a USB3 camera. (322UC)
Definition
ENeptuneError ntcSetDayNightModeSelector(NeptuneCamHandle hCamHandle,
ENeptuneDayNightMode eDayNightMode);
Parameters
[IN] hCamHandle : camera handle
[IN] eDayNightMode : DayNight mode
Remark
You may select the DayNight mode of the camera by using this API function. ENeptuneDayNightMode
is defined in "NeptuneDef.h" as follows:
enum ENeptuneDayNightMode
{
NEPTUNE_DAYNIGHT_AUTO = 0,
NEPTUNE_DAYNIGHT_COLOR = 1,
NEPTUNE_DAYNIGHT_MONO = 2,
NEPTUNE_DAYNIGHT_EXT = 3,
};
Example
ntcSetDayNightModeSelector(hCamHandle,NEPTUNE_DAYNIGHT_AUTO);
See Also
ntcGetDayNightModeSelector
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 96
4.6.18 ntcGetDayNightModeSelector
Description
Get DayNight mode from a USB3 camera. (322UC)
Definition
ENeptuneError ntcGetDayNightModeSelector(NeptuneCamHandle hCamHandle,
ENeptuneDayNightMode* peDayNightMode)
Parameters
[IN] hCamHandle : camera handle
[OUT] peDayNightMode : DayNight mode
Remark
Example
ENeptuneDayNightMode eMode;
ntcGetDayNightModeSelector(hCamHandle, &eMode);
See Also
ntcSetDayNightModeSelector
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 97
struct NEPTUNE_TRIGGER_INFO {
ENeptuneBoolean bSupport; // trigger support flag
_uint16_t nModeFlag; // bit mask for trigger mode
_uint16_t nSourceFlag; // bit mask for trigger source
_uint16_t nPolarityFlag; // bit mask for polarity
_uint16_t nParamMin; // trigger parameter minimum value
_uint16_t nParamMax; // trigger parameter maximum value
};
typedef NEPTUNE_TRIGGER_INFO * PNEPTUNE_TRIGGER_INFO;
struct NEPTUNE_TRIGGER {
ENeptuneTriggerSource Source; // trigger source value
ENeptuneTriggerMode Mode; // trigger mode value
ENeptunePolarity Polarity; // trigger polarity value
ENeptuneBoolean OnOff; // trigger on/off
_uint16_t nParam; // trigger parameter
};
typedef NEPTUNE_TRIGGER* PNEPTUNE_TRIGGER;
In the “NEPTUNE_TRIGGER_INFO” structure, the “bSupport” element means the support of trigger. The
“nModeFlag”, “nSourceFlag” and “nPolarityFlag” express support of trigger mode, trigger source and trigger
polarity with bit flag as below.
The “nParamMin” and “nParamMax” are the range of trigger parameter supported which is used for several
trigger modes except mode0. Please refer to the camera manual for details about the trigger parameter.
The “NEPTUNE_TRIGGER” structure is used to get the current trigger value or to set the trigger.
Enumeration values are defined as below.
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 98
enum ENeptuneTriggerSource
{
NEPTUNE_TRIGGER_SOURCE_LINE1 = 0, // external(H/W trigger)
NEPTUNE_TRIGGER_SOURCE_SW =7 // software trigger
};
enum ENeptuneTriggerMode
{
NEPTUNE_TRIGGER_MODE_0 = 0, // trigger mode 0
NEPTUNE_TRIGGER_MODE_1, // trigger mode 1
NEPTUNE_TRIGGER_MODE_2, // trigger mode 2
NEPTUNE_TRIGGER_MODE_3, // trigger mode 3
NEPTUNE_TRIGGER_MODE_4, // trigger mode 4
NEPTUNE_TRIGGER_MODE_5, // trigger mode 5
NEPTUNE_TRIGGER_MODE_6, // trigger mode 6
NEPTUNE_TRIGGER_MODE_7, // trigger mode 7
NEPTUNE_TRIGGER_MODE_8, // trigger mode 8
NEPTUNE_TRIGGER_MODE_9, // trigger mode 9
NEPTUNE_TRIGGER_MODE_10, // trigger mode 10
NEPTUNE_TRIGGER_MODE_11, // trigger mode 11
NEPTUNE_TRIGGER_MODE_12, // trigger mode 12
NEPTUNE_TRIGGER_MODE_13, // trigger mode 13
NEPTUNE_TRIGGER_MODE_14, // trigger mode 14
NEPTUNE_TRIGGER_MODE_15 // trigger mode 15
};
enum ENeptunePolarity
{
NEPTUNE_POLARITY_RISINGEDGE = 0, // rising edge
NEPTUNE_POLARITY_FALLINGEDGE = 1, // falling edge
NEPTUNE_POLARITY_ANYEDGE = 2, // any edge
NEPTUNE_POLARITY_LEVELHIGH = 3, // high level
NEPTUNE_POLARITY_LEVELLOW = 4 // low level
};
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 99
4.7.1 ntcGetTriggerInfo
Description
Get the trigger information supported by a camera.
Definition
ENeptuneError ntcGetTriggerInfo(NeptuneCamHandle hCamHandle,
PNEPTUNE_TRIGGER_INFO pTriggerInfo)
Parameters
[IN] hCamHandle : camera handle
[OUT] pTriggerInfo : trigger information
Remark
This API function returns the trigger information of a camera. As the trigger mode, trigger source,
trigger polarity is expressed with bit flag, user can know the trigger information by checking the
respective bit values.
Example
ref. NeptuneC Library\Samples\C++\GUI\3.Trigger
NEPTUNE_TRIGGER_INFO TriggerInfo;
// trigger source
if ( TriggerInfo.nSourceFlag & 0x1 )
// external(H/W) trigger support
if ( TriggerInfo.nSourceFlag & 0x7 )
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 100
// trigger polarity
_uint16_t nPolarity = TriggerInfo.nPolarityFlag;
for ( _uint16_t i = 0; i < 16; i++ )
{
// polarity check
if ( (nPolarty >> i) & 0x1 )
{
// do something
}
}
}
See Also
ntcGetTrigger, ntcSetTrigger
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 101
4.7.2 ntcGetTrigger
Description
Get the current trigger value from a camera.
Definition
ENeptuneError ntcGetTrigger(NeptuneCamHandle hCamHandle,
PNEPTUNE_TRIGGER pTrigger)
Parameters
[IN] hCamHandle : camera handle
[OUT] pTrigger : trigger value
Remark
This API function is used to get the current trigger value of a camera. All values except parameter is
expressed as enumeration type.
Example
ref. NeptuneC Library\Samples\C++\GUI\3.Trigger
NEPTUNE_TRIGGER Trigger;
See Also
ntcSetTrigger
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 102
4.7.3 ntcSetTrigger
Description
Set trigger value to a camera.
Definition
ENeptuneError ntcSetTrigger(NeptuneCamHandle hCamHandle, NEPTUNE_TRIGGER Trigger)
Parameters
[IN] hCamHandle : camera handle
[IN] Trigger : trigger value
Remark
This function is used to set user trigger values to a camera.
Example
ref. NeptuneC Library\Samples\C++\GUI\3.Trigger
NEPTUNE_TRIGGER Trigger;
See Also
ntcGetTrigger
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 103
4.7.4 ntcGetTriggerDelay
Description
Get trigger delay value.
Definition
ENeptuneError ntcGetTriggerDelay(NeptuneCamHandle hCamHandle, _uint32_t* pnDelay,
_uint32_t* pnMin=NULL, _uint32_t* pnMax=NULL)
Parameters
[IN] hCamHandle : camera handle
[OUT] pnDelay : trigger delay value
[OUT] pnMin : minimum trigger delay value
[OUT] pnMax : maximum trigger delay value
Remark
This API function is used to read the trigger delay value from a camera. Please refer to the camera
manual for details about the trigger delay.
Example
_uint32_t nValue, nMin, nMax;
See Also
ntcSetTriggerDelay
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 104
4.7.5 ntcSetTriggerDelay
Description
Set trigger delay value.
Definition
ENeptuneError ntcSetTriggerDelay(NeptuneCamHandle hCamHandle, _uint32_t nDelay)
Parameters
[IN] hCamHandle : camera handle
[IN] nDelay : trigger delay value
Remark
This API function is used set trigger delay value to a camera.
Example
ntcSetTriggerDelay(hCamHandle, 500);
See Also
ntcGetTriggerDelay
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 105
4.7.6 ntcRunSWTrigger
Description
Generate the software trigger signal.
Definition
ENeptuneError ntcRunSWTrigger(NeptuneCamHandle hCamHandle)
Parameters
[IN] hCamHandle : camera handle
Remark
This API function make camera to transfer trigger image data if trigger source is set as “Software”.
User should set the trigger source as “NEPTUNE_TRIGGER_SOURCE_SW” when he calls the
“ntcSetTrigger” function.
Example
ref. NeptuneC Library\Samples\C++\GUI\3.Trigger
ntcRunSWTrigger(hCamHandle);
See Also
ntcGetTrigger, ntcSetTrigger
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 106
4.7.7 ntcReadTriggerTable
Description
Read trigger table of given index.
Definition
ENeptuneError ntcReadTriggerTable(NeptuneCamHandle hCamHandle,
PNEPTUNE_TRIGGER_TABLE pTriggerTable)
Parameters
[IN] hCamHandle : camera handle
[OUT] pTriggerTable : trigger table
Remark
This API function is used to get the trigger table which is used for trigger mode 12 and 13. The trigger
mode 12 and 13 can send up to 255 frames and user can set different gain and shutter values for each
frame. Please refer to the camera manual for details about the trigger mode 12 and 13.
The trigger table is passed with the “NEPTUNE_TRIGGER_TABLE” structure as defined below.
struct NEPTUNE_TRIGGER_PARAM {
_uint32_t nShutterValue; // shutter feature value
_uint32_t nGainValue; // gain feature value
_uint32_t nIncrement; // end of table(0) or continuous(1)
_uint32_t nFrameOrder; // frame sequence number
};
struct NEPTUNE_TRIGGER_TABLE {
// trigger parameter : max 255
NEPTUNE_TRIGGER_PARAM Param[MAX_TRIGGER_PARAM];
_uint32_t Index; // 0 ~ 15
};
typedef NEPTUNE_TRIGGER_TABLE* PNEPTUNE_TRIGGER_TABLE;
Example
ref. NeptuneC Library\Samples\C++\GUI\7.Advanced\TriggerExtraParam
NEPTUNE_TRIGGER_TABLE TriggerTable;
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 107
// if end of table
if ( TriggerTable.Param[i].nIncrement == 0 )
break;
}
}
See Also
ntcSaveTriggerTable, ntcLoadTriggerTable
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 108
4.7.8 ntcSaveTriggerTable
Description
Save trigger table to a given index.
Definition
ENeptuneError ntcSaveTriggerTable(NeptuneCamHandle hCamHandle,
NEPTUNE_TRIGGER_TABLE TriggerTable)
Parameters
[IN] hCamHandle : camera handle
[IN] TriggerTable : trigger table
Remark
This API function is used to save trigger table to a camera. The number of trigger table indexes
supported by a camera may different according to the camera mode and maximum value is 15. Please
refer to the camera manual for details about the trigger table.
Example
ref. NeptuneC Library\Samples\C++\GUI\7.Advanced\TriggerExtraParam
NEPTUNE_TRIGGER_TABLE TriggerTable;
See Also
ntcGetTriggerTable, ntcLoadTriggerTable
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 109
4.7.9 ntcLoadTriggerTable
Description
Make camera to load trigger table of given index.
Definition
ENeptuneError ntcLoadTriggerTable(NeptuneCamHandle hCamHandle, _uint32_t nIndex)
Parameters
[IN] hCamHandle : camera handle
[IN] nIndex : trigger table index
Remark
This API function is used to make camera to load trigger table when the trigger table is saved in a
camera with the “ntcSaveTriggerTable” function.
Example
ntcLoadTriggerTable(hCamHandle, 0);
See Also
ntcGetTriggerTable, ntcSaveTriggerTable
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 110
4.7.10 ntcSetTriggerMode14Exposure
Description
Set exposure time value for trigger mode14 to a camera.
Definition
ENeptuneError ntcSetTriggerMode14Exposure(NeptuneCamHandle hCamHandle,
_uint32_t nExposure, _uint32_t nInterval)
Parameters
[IN] hCamHandle : camera handle
[IN] nExposure : exposure time value for trigger mode14
[IN] nInterval : exposure time interval for trigger mode14
Remark
This function is used to exposure time and interval used for trigger mode14. Please refer to the camera
manual for details how trigger mode14 works.
Example
ref. NeptuneC Library\Samples\C++\GUI\3.Trigger
_uint32_t nExposure = 1000;
_uint32_t nInterval = 1000;
See Also
ntcSetTrigger
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 111
4.7.11 ntcSetUSBTriggerBufferCount
Description
Set the number of buffers used in trigger mode of the USB3 camera
Definition
ENeptuneError ntcSetUSBTriggerBufferCount(NeptuneCamHandle hCamHandle, _uint32_t
nCount)
Parameters
[IN] hCamHandle : camera handle
[IN] nCount : number of buffer
Remark
It is valid to a usb3 camera only, default value is 10.
Example
_uint32_t nCount = 5;
See Also
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 112
struct NEPTUNE_STROBE_INFO {
ENeptuneBoolean bSupport; // support of strobe
_uint16_t nStrobeFlag; // support strobes bit flag
_uint16_t nDurationMin; // strobe duration minimum value
_uint16_t nDurationMax; // strobe duration maximum value
_uint16_t nDelayMin; // strobe delay minimum value
_uint16_t nDelayMax; // strobe delay maximum value
_uint16_t nPolarityFlag; // strobe polarity support bit flag
};
typedef NEPTUNE_STROBE_INFO* PNEPTUNE_STROBE_INFO;
struct NEPTUNE_STROBE {
ENeptuneBoolean OnOff; // strobe on/off control
ENeptuneStrobe Strobe; // strobe index
_uint16_t nDuration; // strobe duration value
_uint16_t nDelay; // strobe delay value
ENeptunePolarity Polarity; // strobe polarity
};
typedef NEPTUNE_STROBE* PNEPTUNE_STROBE;
In “NEPTUNE_STROBE_INFO” structure, “nStrobeFlag” and “nPolarityFlag” express the strobe and polarity
supported by a camera with bit flag as was in trigger section. Bit value has meaning as below.
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 113
4.8.1 ntcGetStrobeInfo
Description
Get the strobe information from a camera.
Definition
ENeptuneError ntcGetStrobeInfo(NeptuneCamHandle hCamHandle,
PNEPTUNE_STROBE_INFO pStrobeInfo)
Parameters
[IN] hCamHandle : camera handle
[OUT] pStrobeInfo : strobe information
Remark
The strobe supported by a camera depends on the camera model. Please refer to the camera manual
for details.
Example
ref. NeptuneC Library\Samples\C++\GUI\3.Trigger
NEPTUNE_STROBE_INFO StrobeInfo;
// strobe polarity
nPolarity = StrobeInfo.nPolarityFlag;
for ( i = 0; i < 16; i++ )
if ( (nPolarityFlag >> i) & 0x1 )
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 114
{
// polarity support, do something
}
See Also
ntcGetStrobe, ntcSetStrobe
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 115
4.8.2 ntcGetStrobe
Description
Get current strobe value.
Definition
ENeptuneError ntcGetStrobe(NeptuneCamHandle hCamHandle, PNEPTUNE_STROBE pStrobe)
Parameters
[IN] hCamHandle : camera handle
[OUT] pStrobe : strobe value
Remark
This API function is used for getting current strobe value from a camera.
Example
ref. NeptuneC Library\Samples\C++\GUI\3.Trigger
NEPTUNE_STROBE Strobe;
See Also
ntcGetStrobeInfo, ntcSetStrobe
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 116
4.8.3 ntcSetStrobe
Description
Set strobe value to a camera.
Definition
ENeptuneError ntcSetStrobe(NeptuneCamHandle hCamHandle, NEPTUNE_STROBE Strobe)
Parameters
[IN] hCamHandle : camera handle
[IN] Strobe : strobe value
Remark
This API function is used to set strobe value to a camera.
Example
ref. NeptuneC Library\Samples\C++\GUI\3.Trigger
NEPTUNE_STROBE Strobe;
Strobe.Strobe = NEPTUNE_STROBE0;
Strobe.Polarity = NEPTUNE_POLARITY_RISINGEDGE;
Strobe.nDuration = 200;
Strobe.nDelay = 150;
Strobe.OnOff = NEPTUNE_BOOL_TRUE;
ntcSetStrobe(hCamHandle, Strobe);
See Also
ntcGetStrobeInfo, ntcGetStrobe
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 117
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 118
4.9.1 ntcSetAutoIrisMode
Description
Set auto iris operation mode to a camera.
Definition
ENeptuneError ntcSetAutoIrisMode(NeptuneCamHandle hCamHandle,
ENeptuneAutoIrisMode eMode)
Parameters
[IN] hCamHandle : camera handle
[IN] eMode: auto iris operation mode
Remark
This API function is used to set the operation mode of auto iris. The operation mode is controlled with
the “ENeptuneAutoIrisMode” enumeration defined as below.
enum ENeptuneAutoIrisMode
{
NEPTUNE_AUTOIRIS_MODE_MANUAL = 0,
NEPTUNE_AUTOIRIS_MODE_AUTO = 1,
};
Example
ntcSetAutoIrisMode(hCamHandle, NEPTUNE_AUTOIRIS_MODE_AUTO);
See Also
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 119
4.9.2 ntcGetAutoIrisAverageFrame
Description
Get the number of frames used for the auto iris.
Definition
ENeptuneError ntcGetAutoIrisAverageFrame(NeptuneCamHandle hCamHandle,
_uint32_t* pnValue,
_uint32_t* pnMin=NULL,
_uint32_t* pnMax=NULL)
Parameters
[IN] hCamHandle : camera handle
[OUT] pnValue : the number of frames used for the auto iris
[OUT, Optional] pnMin : minimum value of the number of frames used for the auto iris
[OUT, Optional] pnMax : maximum value of the number of frames used for the auto iris
Remark
This API function is used to get the number of frames used for calculating brightness when auto iris is
working.
Example
_uint32_t nValue, nMin, nMax;
ntcGetAutoIrisAverageFrame(hCamHandle, &nValue, &nMin, &nMax);
See Also
ntcSetAutoIrisAverageFrame
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 120
4.9.3 ntcSetAutoIrisAverageFrame
Description
Set the number of frames used for the auto iris.
Definition
ENeptuneError ntcSetAutoIrisAverageFrame(NeptuneCamHandle hCamHandle,
_uint32_t nValue)
Parameters
[IN] hCamHandle : camera handle
[IN] nValue : the number of frames used for the auto iris
Remark
This API function is used to set the number of frames used for calculating brightness when auto iris is
working.
Example
ntcSetAutoIrisAverageFrame(hCamHandle, 10);
See Also
ntcGetAutoIrisAverageFrame
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 121
4.9.4 ntcGetAutoIrisTargetValue
Description
Get the target brightness information of auto iris.
Definition
ENeptuneError ntcGetAutoIrisTargetValue(NeptuneCamHandle hCamHandle,
_uint32_t* pnValue,
_uint32_t* pnMin=NULL, _uint32_t* pnMax=NULL)
Parameters
[IN] hCamHandle : camera handle
[OUT] pnValue : target brightness value of auto iris
[OUT, Optional] pnMin : minimum target brightness value of auto iris
[OUT, Optional] pnMax : maximum target brightness value of auto iris
Remark
This API function is used to get information of target brightness used for auto iris.
Example
_uint32_t nValue, nMin, nMax;
ntcGetAutoIrisTargetValue(hCamHandle, &nValue, &nMin, &nMax);
See Also
ntcSetAutoIrisTargetValue
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 122
4.9.5 ntcSetAutoIrisTargetValue
Description
Set the target brightness value of auto iris.
Definition
ENeptuneError ntcSetAutoIrisTargetValue(NeptuneCamHandle hCamHandle,
_uint32_t nValue)
Parameters
[IN] hCamHandle : camera handle
[IN] nValue : target brightness value of auto iris
Remark
This API function is used to set target brightness of auto iris.
Example
ntcSetAutoIrisTargetValue(hCamHandle, 128);
See Also
ntcGetAutoIrisTargetValue
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 123
struct NEPTUNE_GPIO {
ENeptuneGPIO Gpio; // GPIO index
ENeptuneGPIOSource Source; // GPIO source
ENeptuneGPIOValue Value; // GPIO value
};
typedef NEPTUNE_GPIO* PNEPTUNE_GPIO;
enum ENeptuneGPIO {
NEPTUNE_GPIO_LINE0 = 0, // GPIO 0
NEPTUNE_GPIO_LINE1 // GPIO 1
};
enum ENeptuneGPIOSource {
NEPTUNE_GPIO_SOURCE_STROBE = 0, // strobe
NEPTUNE_GPIO_SOURCE_USER // user defined
};
enum ENeptuneGPIOValue {
NEPTUNE_GPIO_VALUE_LOW = 0, // low level
NEPTUNE_GPIO_VALUE_HIGH // high level
};
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 124
4.10.1 ntcSetGPIO
Description
Set GPIO to camera.
Definition
ENeptuneError ntcSetGPIO(NeptuneCamHandle hCamHandle, NEPTUNE_GPIO Gpio)
Parameters
[IN] hCamHandle : camera handle
[IN] Gpio
Remark
Example
NEPTUNE_GPIO GPIO;
GPIO.Gpio = NEPTUNE_GPIO_LINE0;
GPIO.Source = NEPTUNE_GPIO_SOURCE_STROBE;
GPIO.Value = NEPTUNE_GPIO_VALUE_HIGH;
ntcSetGPIO(hCamHandle, GPIO);
See Also
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 125
struct NEPTUNE_USERSET {
_uint16_t SupportUserSet; // bit flag for supported user set, 0 is "Default"
ENeptuneUserSet UserSetIndex; // user set index to save or load
ENeptuneUserSetCommand Command; // save or load
};
typedef NEPTUNE_USERSET* PNEPTUNE_USERSET;
The “SupportUserSet” expresses the supported UserSet as bit flag and each bit has meaning as below.
The “UserSetIndex” is the index information and “Command” is control to save or load as defined below.
enum ENeptuneUserSet {
NEPTUNE_USERSET_DEFAULT = 0,
NEPTUNE_USERSET_1 = 1,
NEPTUNE_USERSET_2 = 2,
NEPTUNE_USERSET_3 = 3,
NEPTUNE_USERSET_4 = 4,
NEPTUNE_USERSET_5 = 5,
NEPTUNE_USERSET_6 = 6,
NEPTUNE_USERSET_7 = 7,
NEPTUNE_USERSET_8 = 8,
NEPTUNE_USERSET_9 = 9,
NEPTUNE_USERSET_10 = 10,
NEPTUNE_USERSET_11 = 11,
NEPTUNE_USERSET_12 = 12,
NEPTUNE_USERSET_13 = 13,
NEPTUNE_USERSET_14 = 14,
NEPTUNE_USERSET_15 = 15
};
enum ENeptuneUserSetCommand {
NEPTUNE_USERSET_CMD_LOAD = 0,
NEPTUNE_USERSET_CMD_SAVE = 1,
};
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 126
4.11.1 ntcGetUserSet
Description
Get UserSet information supported by a camera.
Definition
ENeptuneError ntcGetUserSet(NeptuneCamHandle hCamHandle,
PNEPTUNE_USERSET pUserSet)
Parameters
[IN] hCamHandle : camera handle
[OUT] pUserSet : UserSet information
Remark
Only the “SupportedUserSet” element is used for getting information from a camera and number of
supported UserSet may different to the camera model.
Example
ref. NeptuneC Library\Samples\C++\GUI\7.Advanced\UserSet
NEPTUNE_USERSET UserSet;
if ( ntcGetUserSet(hCamHandle, &UserSet) == NEPTUNE_ERR_Success )
{
// check support user set
for ( _uint16_t i = 0; i < 16; i++ )
{
if ( UserSet.SupportUserSet & (0x0001 << i) )
{
// bit 0 is default
if ( i == 0 )
// default
else
// userset[1~15]
}
}
}
See Also
ntcSetUserSet, ntcSetDefaultUserSet, ntcSetPowerOnDefaultUserSet
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 127
4.11.2 ntcSetUserSet
Description
Control camera to save or load UserSet.
Definition
ENeptuneError ntcSetUserSet(NeptuneCamHandle hCamHandle,
NEPTUNE_USERSET UserSet)
Parameters
[IN] hCamHandle : camera handle
[IN] UserSet : UserSet information
Remark
This API is used to save camera information to given UserSet index or load camera information from
given UserSet. The information save to UserSet is diffent to the UserSet index. From UserSet1 to
UserSet4, only the feature information is saved. And other UserSets save other control information
including pixel format, frame rate, trigger information etc. Please refer to the camera manual for details.
If a camera loads the saved information, the information between the camera and application is not
matched because camera applies value to current setting. So, read the camera information after
loading the UserSet to synchronize application and camera.
Example
ref. NeptuneC Library\Samples\C++\GUI\7.Advanced\UserSet
NEPTUNE_USERSET UserSet;
UserSet.UserSetIndex = NEPTUNE_USERSET_1;
UserSet.Command = NEPTUNE_USERSET_CMD_SAVE
See Also
ntcGetUserSet, ntcSetDefaultUserSet, ntcSetPowerOnDefaultUserSet
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 128
4.11.3 ntcSetDefaultUserSet
Description
Set the UserSet index used as default.
Definition
ENeptuneError ntcSetDefaultUserSet(NeptuneCamHandle hCamHandle,
ENeptuneUserSet eUserSet)
Parameters
[IN] hCamHandle : camera handle
[IN] eUserSet : UserSet index
Remark
This API function is used to set the default UserSet other then “Default” UserSet.
Example
// save information to user set 2
NEPTUNE_USERSET UserSet;
UserSet.UserSetIndex = NEPTUNE_USERSET_2;
UserSet.Command = NEPTUNE_USERSET_CMD_SAVE
ntcSetUserSet(hCamHandle, UserSet);
See Also
ntcGetUserSet, ntcSetUserSet, ntcSetPowerOnDefaultUserSet
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 129
4.11.4 ntcSetPowerOnDefaultUserSet
Description
Set the UserSet used when camera is power on.
Definition
ENeptuneError ntcSetPowerOnDefaultUserSet(NeptuneCamHandle hCamHandle,
ENeptuneUserSet eUserSet)
Parameters
[IN] hCamHandle : camera handle
[IN] eUserSet : UserSet index
Remark
This API function is used to set a camera to use specific UserSet when a camera is power on. With this
function, user can set camera to power on with desired value always.
Example
ref. NeptuneC Library\Samples\C++\GUI\7.Advanced\UserSet
// save information to user set 2
NEPTUNE_USERSET UserSet;
UserSet.UserSetIndex = NEPTUNE_USERSET_2;
UserSet.Command = NEPTUNE_USERSET_CMD_SAVE
ntcSetUserSet(hCamHandle, UserSet);
See Also
ntcGetUserSet, ntcSetUserSet, ntcSetDefaultUserSet
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 130
struct NEPTUNE_POINT {
_uint32_t x; // x-coordinate
_uint32_t y; // y-coordinate
};
struct NEPTUNE_KNEE_LUT {
NEPTUNE_POINT Points[4]; // 4 points
ENeptuneBoolean bEnable; // enable/disable state/control
};
typedef NEPTUNE_KNEE_LUT* PNEPTUNE_KNEE_LUT;
struct NEPTUNE_USER_LUT {
_uint16_t SupportLUT; // bit Flag
_uint16_t LUTIndex; // current LUT index
ENeptuneBoolean Enable; // enable/disable state/control
_int16_t Data[4096]; // LUT data, valid only in Set function
};
typedef NEPTUNE_USER_LUT* PNEPTUNE_USER_LUT;
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 131
4.12.1 ntcGetKneeLUT
Description
Get Knee-point look-up-table information.
Definition
ENeptuneError ntcGetKneeLUT(NeptuneCamHandle hCamHandle,
PNEPTUNE_KNEE_LUT pLUTPoints)
Parameters
[IN] hCamHandle : camera handle
[OUT] pLUTPoints : point infomration
Remark
This API function returns the coordinates of 4-points composing Knee-point look-up-table and the
enable/disblae state.
Example
ref. NeptuneC Library\Samples\C++\GUI\7.Advanced\4StepLUT
NEPTUNE_KNEE_LUT KneeLUT;
ntcGetKneeLUT(hCamHandle, &KneeLUT);
KneeLUT.Points[0]; // point1 x, y coordinate
KneeLUT.Points[1]; // point2 x, y coordinate
KneeLUT.Points[2]; // point3 x, y coordinate
KneeLUT.Points[3]; // point4 x, y, coordinate
KneeLUT.bEnable; // enable/disable state
See Also
ntcSetKneeLUT
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 132
4.12.2 ntcSetKneeLUT
Description
Set 4-point look-up-table to a camera.
Definition
ENeptuneError ntcSetKneeLUT(NeptuneCamHandle hCamHandle,
NEPTUNE_KNEE_LUT LUTPoints)
Parameters
[IN] hCamHandle : camera handle
[IN] LUTPoints : point information
Remark
This API function is used to set 4-point composing Knee-point look-up-table.
Example
ref. NeptuneC Library\Samples\C++\GUI\7.Advanced\4StepLUT
NEPTUNE_KNEE_LUT KneeLUT;
See Also
ntcGetKneeLUT
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 133
4.12.3 ntcGetUserLUT
Description
Get the number of User Defined look-up-table supported by a camera.
Definition
ENeptuneError ntcGetUserLUT(NeptuneCamHandle hCamHandle,
PNEPTUNE_USER_LUT pLUTData)
Parameters
[IN] hCamHandle : camera handle
[OUT] pLUTData : table information
Remark
This API function returns the number of look-up-table, current table index and enable state of a table.
The supported look-up-table is expressed as bit flag in the “SupportLUT” element.
Example
ref. NeptuneC Library\Samples\C++\GUI\7.Advanced\UserLUT
NEPTUNE_USER_LUT UserLUT;
See Also
ntcSetUserLUT
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 134
4.12.4 ntcSetUserLUT
Description
Save look-up-table to a camera.
Definition
ENeptuneError ntcSetUserLUT(NeptuneCamHandle hCamHandle,
NEPTUNE_USER_LUT LUTData)
Parameters
[IN] hCamHandle : camera handle
[IN] LUTData : look-up-table
Remark
This API function is used to save look-up-table to a given index and to control table state. The size of
the table is 4096.
Example
ref. NeptuneC Library\Samples\C++\GUI\7.Advanced\UserLUT
NEPTUNE_USER_LUT UserLUT;
See Also
ntcGetUserLUT
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 135
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 136
4.13.1 ntcGetFrameSave
Description
Get frame save information from a camera.
Definition
ENeptuneError ntcGetFrameSave(NeptuneCamHandle hCamHandle,
ENeptuneBoolean* peOnOff,
_uint32_t* pnFrameRemained)
Parameters
[IN] hCamHandle : camera handle
[OUT] peOnOff : On/Off state
[OUT] pnFrameRemained : number of frames remained in camera memory
(valid only when peOnOff=NEPTUNE_BOOL_TRUE)
Remark
This API function returns frame save control state and the number of frames saved in camera’s
memory.
Example
ref. NeptuneC Library\Samples\C++\GUI\7.Advanced\FrameSave
ENeptuneBoolean bOnOff; // enable state
_uint32_t nFrames; // number of frames in camera memory
See Also
ntcSetFrameSave
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 137
4.13.2 ntcSetFrameSave
Description
Set frame save control to a camera.
Definition
ENeptuneError ntcSetFrameSave(NeptuneCamHandle hCamHandle,
ENeptuneBoolean eOnOff, ENeptuneBoolean eTransfer,
_uint32_t nFrames)
Parameters
[IN] hCamHandle : camera handle
[IN] eOnOff : on/off control
[IN] eTransfer : transfer control
[IN] nFrames : number of frames to transfer
Remark
This API function is used to get the frames saved in the camera memory.
Once frame save is enabled, camera stop transfer image to interface and start save image to its
memory. User can control camera to transfer with “eTransfer” and “nFrames” parameter. If the second
parameter is “NEPTUNE_BOOL_FALSE”, then third and fourth parameter is ignored.
Example
ref. NeptuneC Library\Samples\C++\GUI\7.Advanced\FrameSave
// enable frame save
ntcSetFrameSave(hCamHandle, NEPTUNE_BOOL_TRUE, NEPTUNE_BOOL_FALSE, 0);
// transfer control
ntcSetFrameSave(hCamHandle, NEPTUNE_BOOL_TRUE, NEPTUNE_BOOL_TRUE, 10);
See Also
ntcGetFrameSave
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 138
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 139
4.14.1 ntcSetSIO
Description
Set RS232 environment to camera.
Definition
ENeptuneError ntcSetSIO(NeptuneCamHandle hCamHandle,
NEPTUNE_SIO_PROPERTY Property)
Parameters
[IN] hCamHandle : camera handle
[IN] Property : RS232 information
Remark
This API function is used to set the RS232 port information in a camera. The
“NEPTUNE_SIO_PROPERTY” structure is defined as below.
enum ENeptuneSIOParity
{
NEPTUNE_SIO_PARITY_NONE = 0,
NEPTUNE_SIO_PARITY_ODD = 1,
NEPTUNE_SIO_PARITY_EVEN = 2,
};
struct NEPTUNE_SIO_PROPERTY
{
ENeptuneBoolean bEnable; // RS232 enable
_uint32_t Baudrate; // serial baudrate
ENeptuneSIOParity Parity; // parity bit
_uint32_t DataBit; // data bit
_uint32_t SoptBit; // stop bit
NEPTUNE_SIO_PROPERTY()
{
bEnable = NEPTUNE_BOOL_FALSE;
Baudrate = 9600;
Parity = NEPTUNE_SIO_PARITY_NONE;
DataBit = 8;
SoptBit = 1;
}
};
typedef NEPTUNE_SIO_PROPERTY* PNEPTUNE_SIO_PROPERTY;
Example
ref. NeptuneC Library\Samples\C++\GUI\7.Advanced\SIOControl
NEPTUNE_SIO_PROPERTY SIOProp;
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 140
SIOProp.BaudRate = 9600;
SIOProp.Parity = NEPTUNE_SIO_PARITY_NONE;
SIOProp.DataBit = 8;
SIOProp.StopBit = 1;
SIOProp.bEnable = NEPTUNE_BOOL_TRUE;
ntcSetSIO(hCamHandle, SIOProp);
See Also
ntcWriteSIO, ntcReadSIO
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 141
4.14.2 ntcWriteSIO
Description
Write RS232 data to a camera.
Definition
ENeptuneError ntcWriteSIO(NeptuneCamHandle hCamHandle, NEPTUNE_SIO Data)
Parameters
[IN] hCamHandle : camera handle
[IN] Data : RS232 data
Remark
This API function is used to send RS232 data to a camera after setting the RS232 environment and it
tries to send data for “nTimeOut”. The “NEPTUNE_SIO” structure defined as below.
struct NEPTUNE_SIO
{
_uint32_t TextCount; // should be smaller than or equal to 256
_char_t strText[256]; // RS232 data
_uint32_t TimeOut; // in ms unit
};
typedef NEPTUNE_SIO* PNEPTUNE_SIO;
Example
ref. NeptuneC Library\Samples\C++\GUI\7.Advanced\SIOControl
NEPTUNE_SIO SIOData;
ntcWriteSIO(hCamHandle, SIOData);
See Also
ntcSetSIO, ntcReadSIO
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 142
4.14.3 ntcReadSIO
Description
Read RS232 data from a camera.
Definition
ENeptuneError ntcReadSIO(NeptuneCamHandle hCamHandle, PNEPTUNE_SIO pData)
Parameters
[IN] hCamHandle : camera handle
[OUT] pData : RS232 data
Remark
This API function returns the RS232 data passed to a camera frome external device via RS232.
Example
ref. NeptuneC Library\Samples\C++\GUI\7.Advanced\SIOControl
NEPTUNE_SIO SIOData;
SIOData.TextCount = 10;
SIOData.TimeOut = 3000;
See Also
ntcSetSIO, ntcWriteSIO
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 143
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 144
4.15.1 ntcReadRegister
Description
Read camera register.
Definition
ENeptuneError ntcReadRegister(NeptuneCamHandle hCamHandle,
_ulong32_t ulAddr, _ulong32_t* pulVal)
Parameters
[IN] hCamHandle : camera handle
[IN] ulAddr : register address
[OUT] pulVal : register value
Remark
This API function returns register value of given register in 4-byte unit.
Example
_ulong32_t ulVal;
ntcReadRegister(hCamHandle, 0xa000, &ulVal);
See Also
ntcWriteRegister, ntcReadBlock, ntcWriteBlock
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 145
4.15.2 ntcWriteRegister
Description
Write data to a camera register.
Definition
ENeptuneError ntcWriteRegister(NeptuneCamHandle hCamHandle,
_ulong32_t ulAddr, _ulong32_t ulVal)
Parameters
[IN] hCamHandle : camera handle
[IN] ulAddr : register address
[IN] ulVal : data value
Remark
This API function is used to write value to camera register in 4-byte unit.
Example
ntcWriteRegister(hCamHandle, 0xF2F10144, 0x82000000);
See Also
ntcReadRegister, ntcReadBlock, ntcWriteBlock
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 146
4.15.3 ntcReadBlock
Description
Read data from camera registers
Definition
ENeptuneError ntcReadBlock(NeptuneCamHandle hCamHandle,
_ulong32_t ulAddr, _uint8_t* pBuf, _ulong32_t* pnSize)
Parameters
[IN] hCamHandle : camera handle
[IN] ulAddr : start register address
[OUT] pBuf : data buffer
[IN/OUT] pnSize : size of buffer
Remark
This API function is used to read multiple camera register at once. Camera register is increased
internally.
Example
_uint8_t Buf[32];
_ulong32_t nSize = 32;
See Also
ntcReadRegister, ntcWriteRegister, ntcWriteBlock
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 147
4.15.4 ntcWriteBlock
Description
Write data to camera registers.
Definition
ENeptuneError ntcWriteBlock(NeptuneCamHandle hCamHandle,
_ulong32_t ulAddr, _uint8_t* pBuf, _ulong32_t nSize)
Parameters
[IN] hCamHandle : camera handle
[IN] ulAddr : start register address
[IN] pBuf : data buffer
[IN] nSize : size of buter
Remark
This API function is used for writing data to several registers at once.
Example
_uint8_t Buf[32];
_ulong32_t nSize = 32;
See Also
ntcReadRegister, ntcWriteRegister, ntcReadBlock
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 148
4.15.5 ntcWriteBroadcast
Description
Write data to all connected 1394 camera register.
Definition
ENeptuneError ntcWriteBroadcast(NeptuneCamHandle hCamHandle,
_ulong32_t ulAddr, _ulong32_t ulVal)
Parameters
[IN] hCamHandle : camera handle
[IN] ulAddr : register address
[IN] ulVal : data value
Remark
This API function is used to write same value to all connected 1394 camra which is located in same bus
at the same time. User can use any handle of 1394 camera.
Example
// write gain to all 1394 camera
ntcWriteBroadcast(hCamHandle, 0xF0F00820, 0x82000014);
See Also
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 149
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 150
4.16.1 ntcGetNodeVisibility
Description
Get the visibility of XML tree.
Definition
ENeptuneError ntcGetNodeVisibility(NeptuneCamHandle hCamHandle,
ENeptuneNodeVisibility* peVisibility)
Parameters
[IN] hCamHandle : camera handle
[OUT] peVisibility : XML tree visibility
Remark
There are 3 visibilities in the camera XML tree – Beginner, Expert, Guru and this visibility restrain from
showing some node according to the value. The Beginner visibility shows only basic nodes and the
Guru visibility shows full XML tree.
The visibility is controlled by the “ENeptuneNodeVisibility” as defined below.
enum ENeptuneNodeVisibility
{
NEPTUNE_NODE_VISIBLE_UNKNOWN = -1,
NEPTUNE_NODE_VISIBLE_BEGINNER = 0, // beginner
NEPTUNE_NODE_VISIBLE_EXPERT = 1, // expert
NEPTUNE_NODE_VISIBLE_GURU = 2 // guru
};
Example
// get XML tree visibility
ENeptuneNodeVisibility eVisibility;
ntcGetNodeVisibility(hCamHandle, &eVisibility);
See Also
ntcSetNodeVisibility
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 151
4.16.2 ntcSetNodeVisibility
Description
Set visibility of XML tree.
Definition
ENeptuneError ntcSetNodeVisibility(NeptuneCamHandle hCamHandle,
ENeptuneNodeVisibility eVisibility)
Parameters
[IN] hCamHandle : camera handle
[IN] eVisibility : XML tree visibility
Remark
This API function is used to control the number of XML tree nodes to be shown.
Example
// set XML tree visibility
ntcSetNodeVisibility(hCamHandle, NEPTUNE_NODE_VISIBLE_GURU);
See Also
ntcGetNodeVisibility
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 152
4.16.3 ntcGetNodeList
Description
Get child nodes of a given node.
Definition
ENeptuneError ntcGetNodeList(NeptuneCamHandle hCamHandle,
const _char_t* pstrCategory,
PNEPTUNE_XML_NODE_LIST pList)
Parameters
[IN] hCamHandle : camera handle
[IN] pstrCategory : parent node
[OUT] pList : child node list
Remark
This API function returns list of child nodes below the given node. If a node doesn’t have any child, the
API returns the structure with “nCount” element as 0.
The list is passed as “NEPTUNE_XML_NODE_LIST” structure defined as below.
struct NEPTUNE_XML_NODE_LIST
{
// number of nodes
_uint32_t nCount;
// XML node list
_char_t pstrList[MAX_NODE_LIST_LENGTH][MAX_STRING_LENGTH];
};
typedef NEPTUNE_XML_NODE_LIST* PNEPTUNE_XML_NODE_LIST;
Example
NEPTUNE_XML_NODE_LIST NodeList;
ntcGetNodeList(hCamHandle, &NodeList);
for ( int i = 0; i < NodeList.nCount; i++ )
NodeList.pstrList[i]; // XML node
See Also
ntcGetNodeInfo
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 153
4.16.4 ntcGetNodeInfo
Description
Get information of a XML tree node.
Definition
ENeptuneError ntcGetNodeInfo(NeptuneCamHandle hCamHandle,
const _char_t* pstrNode,
PNEPTUNE_XML_NODE_INFO pInfo)
Parameters
[IN] hCamHandle : camera handle
[IN] pstrNode : node name
[OUT] pInfo : node information
Remark
The API uses “NEPTUNE_XML_NODE_INFO” structure which includes node type, access mode, visibility
and textual information.
struct NEPTUNE_XML_NODE_INFO
{
// node type(int, float, boolean, string, enumeration, command)
ENeptuneNodeType Type;
// access mode
ENeptuneNodeAccessMode AccessMode;
// node visibility
ENeptuneNodeVisibility Visibility;
// has child ?
_bool8_t bHasChild;
// node name
_char_t strDisplayName[MAX_STRING_LENGTH];
// node tooltip
_char_t strTooltip[MAX_STRING_LENGTH];
// node description
_char_t strDescription[MAX_STRING_LENGTH];
};
typedef NEPTUNE_XML_NODE_INFO* PNEPTUNE_XML_NODE_INFO;
There are integer, float, Boolean, string, enumeration and command types in XML node tree and
appropriate function should be used according the the node type. Node type and access mode
supported by the API is defined as below.
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 154
enum ENeptuneNodeType
{
NEPTUNE_NODE_TYPE_UKNOWN = -1,
NEPTUNE_NODE_TYPE_CATEGORY = 0,
NEPTUNE_NODE_TYPE_COMMAND, // command type node
NEPTUNE_NODE_TYPE_RAW, // raw node
NEPTUNE_NODE_TYPE_STRING, // string node
NEPTUNE_NODE_TYPE_ENUM, // enumeration node
NEPTUNE_NODE_TYPE_INT, // int type node
NEPTUNE_NODE_TYPE_FLOAT, // float type node
NEPTUNE_NODE_TYPE_BOOLEAN // boolean type node
};
enum ENeptuneNodeAccessMode
{
NEPTUNE_NODE_ACCESSMODE_NI = 0, // Not Implemented
NEPTUNE_NODE_ACCESSMODE_NA = 1, // Not Available
NEPTUNE_NODE_ACCESSMODE_WO = 2, // Write Only
NEPTUNE_NODE_ACCESSMODE_RO = 3, // Read Only
NEPTUNE_NODE_ACCESSMODE_RW = 4, // Read, Write
NEPTUNE_NODE_ACCESSMODE_UNDEFINED = 5 // undefined
};
Example
NEPTUNE_XML_NODE_INFO NodeInfo;
See Also
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 155
4.16.5 ntcGetNodeInt
Description
Get information of integer type XML node.
Definition
ENeptuneError ntcGetNodeInt(NeptuneCamHandle hCamHandle,
const _char_t* pstrNode,
PNEPTUNE_XML_INT_VALUE_INFO pValueInfo)
Parameters
[IN] hCamHandle : camera handle
[IN] pstrNode : XML node
[OUT] pValueInfo : node information
Remark
This function is used to get the information when type of a node is “integer”. The information structure
is defined as below.
struct NEPTUNE_XML_INT_VALUE_INFO {
_int64_t nValue; // current value
_int64_t nMin; // minimum value supported
_int64_t nMax; // maximum value supported
_int64_t nInc; // increment step
ENeptuneNodeAccessMode AccessMode; // access mode
};
typedef NEPTUNE_XML_INT_VALUE_INFO* PNEPTUNE_XML_INT_VALUE_INFO;
Example
NEPTUNE_XML_NODE_INFO NodeInfo;
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 156
See Also
ntcGetNodeInfo, ntcSetNodeInt
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 157
4.16.6 ntcSetNodeInt
Description
Set value to an integer type XML node.
Definition
ENeptuneError ntcSetNodeInt(NeptuneCamHandle hCamHandle,
const _char_t* pstrNode, _int64_t nValue)
Parameters
[IN] hCamHandle : camera handle
[IN] pstrNode : XML node
[IN] nValue : value
Remark
This function is use to set value to an integer type XML node.
Example
NEPTUNE_XML_NODE_INFO NodeInfo;
See Also
ntcGetNodeInfo, ntcGetNodeInt
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 158
4.16.7 ntcGetNodeFloat
Description
Get information of float type XML node.
Definition
ENeptuneError ntcGetNodeFloat(NeptuneCamHandle hCamHandle,
const _char_t* pstrNode,
PNEPTUNE_XML_FLOAT_VALUE_INFO pValueInfo)
Parameters
[IN] hCamHandle : camera handle
[IN] pstrNode : XML node
[OUT] pValueInfo : node 정보
Remark
This function is used to get the information when type of a node is “float”. The information structure is
defined as below.
struct NEPTUNE_XML_FLOAT_VALUE_INFO {
_double_t dValue; // current value
_double_t dMin; // minimum
_double_t dMax; // maximum
_double_t dInc; // increment
ENeptuneNodeAccessMode AccessMode;
};
typedef NEPTUNE_XML_FLOAT_VALUE_INFO* PNEPTUNE_XML_FLOAT_VALUE_INFO;
Example
NEPTUNE_XML_NODE_INFO NodeInfo;
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 159
See Also
ntcGetNodeInfo, ntcSetNodeFloat
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 160
4.16.8 ntcSetNodeFloat
Description
Set value to an float type XML node.
Definition
ENeptuneError ntcSetNodeFloat(NeptuneCamHandle hCamHandle,
const _char_t* pstrNode, _double_t dValue)
Parameters
[IN] hCamHandle : camera handle
[IN] pstrNode : XML node
[IN] dValue : node value
Remark
This function is use to set value to a float type XML node.
Example
NEPTUNE_XML_NODE_INFO NodeInfo;
See Also
ntcGetNodeInfo, ntcGetNodeFloat
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 161
4.16.9 ntcGetNodeEnum
Description
Get information of enumeation type XML node.
Definition
ENeptuneError ntcGetNodeEnum(NeptuneCamHandle hCamHandle,
const _char_t* pstrNode,
PNEPTUNE_XML_ENUM_LIST pList)
Parameters
[IN] hCamHandle : camera handle
[IN] pstrNode : XML node
[OUT] pList : node information
Remark
This function is used to get the information when type of a node is “enumeration”. The information
structure is defined as below.
struct NEPTUNE_XML_ENUM_LIST
{
// number of enumeration node string
_uint32_t nCount;
// enumeration node string list
_char_t pstrList[MAX_LIST_LENGTH][MAX_STRING_LENGTH];
// current index of the string list
_uint32_t nIndex;
};
typedef NEPTUNE_XML_ENUM_LIST* PNEPTUNE_XML_ENUM_LIST;
Example
NEPTUNE_XML_NODE_INFO NodeInfo;
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 162
{
// enumeration value
NodeList.pstrList[i];
}
NodeList.nIndex; // current value
}
}
}
See Also
ntcGetNodeInfo, ntcSetNodeEnum
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 163
4.16.10 ntcSetNodeEnum
Description
Set value to an enumeration type XML node.
Definition
ENeptuneError ntcSetNodeEnum(NeptuneCamHandle hCamHandle,
const _char_t* pstrNode, const _char_t* pstrEnum)
Parameters
[IN] hCamHandle : camera handle
[IN] pstrNode : XML node
[IN] pstrEnum : node value
Remark
This function is use to set value to an enumeration type XML node. The enumeration value must be the
one returned from the “ntcGetNodeEnum” function.
Example
NEPTUNE_XML_NODE_INFO NodeInfo;
See Also
ntcGetNodeInfo, ntcGetNodeEnum
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 164
4.16.11 ntcGetNodeString
Description
Get information of string type XML node.
Definition
ENeptuneError ntcGetNodeString(NeptuneCamHandle hCamHandle,
const _char_t* pstrNode,
_char_t* pstrString, _uint32_t* pnSize,
ENeptuneNodeAccessMode* peAccessMode)
Parameters
[IN] hCamHandle : camera handle
[IN] pstrNode : XML node
[OUT] pstrString : node value
[IN/OUT] pnSize : size of buffer
[OUT] peAccessMode : node access mode
Remark
This function is used to get the information when type of a node is “string”.
Example
NEPTUNE_XML_NODE_INFO NodeInfo;
See Also
ntcGetNodeInfo, ntcSetNodeStrnig
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 165
4.16.12 ntcSetNodeString
Description
Set value to an string type XML node.
Definition
ENeptuneError ntcSetNodeString(NeptuneCamHandle hCamHandle,
const _char_t* pstrNode, const _char_t* pstrString)
Parameters
[IN] hCamHandle : camera handle
[IN] pstrNode : XML node
[IN] pstrString : node value
Remark
This function is use to set value to a string type XML node.
Example
NEPTUNE_XML_NODE_INFO NodeInfo;
See Also
ntcGetNodeInfo, ntcGetNodeString
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 166
4.16.13 ntcGetNodeBoolean
Description
Get information of boolean type XML node.
Definition
ENeptuneError ntcGetNodeBoolean(NeptuneCamHandle hCamHandle,
const _char_t* pstrNode, ENeptuneBoolean *peState)
Parameters
[IN] hCamHandle : camera handle
[IN] pstrNode : XML node
[OUT] peState : node value
Remark
This function is used to get the information when type of a node is “boolean”.
Example
NEPTUNE_XML_NODE_INFO NodeInfo;
See Also
ntcGetNodeInfo, ntcSetNodeBoolean
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 167
4.16.14 ntcSetNodeBoolean
Description
Set value to an boolean type XML node.
Definition
ENeptuneError ntcSetNodeBoolean(NeptuneCamHandle hCamHandle,
const _char_t* pstrNode, ENeptuneBoolean eState)
Parameters
[IN] hCamHandle : camera handle
[IN] pstrNode : XML node
[IN] eState : node value
Remark
This function is use to set value to a boolean type XML node.
Example
NEPTUNE_XML_NODE_INFO NodeInfo;
See Also
ntcGetNodeInfo, ntcGetNodeBoolean
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 168
4.16.15 ntcSetNodeCommand
Description
Make command node to execute.
Definition
ENeptuneError ntcSetNodeCommand(NeptuneCamHandle hCamHandle,
const _char_t* pstrNode)
Parameters
[IN] hCamHandle : camera handle
[IN] pstrNode : XML node
Remark
This function is use to execute command type XML node.
Example
NEPTUNE_XML_NODE_INFO NodeInfo;
See Also
ntcGetNodeInfo
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g
NeptuneC API Manual – V5.0.0.0 Page 169
5. Revision History
5.1 Changes from previous version (1.0.0.0)
- 4.6.1 ntcGetFeature is changed(Contrast feature is added).
- 4.6.2 ntcSetFeature is changed(Contrast feature is added).
- 4.6.4 ntcGetAutoAreaControl is newly added.
- 4.6.5 ntcSetAutoAreaControl is newly added.
- 4.6.6 ntcSetAFControl is newly added.
T h e F i r s t Cl a s s of D i gi ta l Im a gi n g